本文整理汇总了C#中System.Windows.Controls.Frame类的典型用法代码示例。如果您正苦于以下问题:C# Frame类的具体用法?C# Frame怎么用?C# Frame使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Frame类属于System.Windows.Controls命名空间,在下文中一共展示了Frame类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Initialize
public static void Initialize(MXApplication theApp, Frame navFrame)
{
MXContainer.InitializeContainer(new MXWindowsContainer(theApp));
MXContainer.Instance.ThreadedLoad = false;
NavigationFrame = navFrame;
}
示例2: MainWindowViewModel
public MainWindowViewModel(Frame CurrentFrame, Dispatcher mainWindowDispatcher)
{
this.currentFrame = CurrentFrame;
this.mainWindowDispatcher = mainWindowDispatcher;
// Initialize Agle as soon as possible
MyAgle = Agle.Agle.GetAgleInstance;
MyAgle.InitializeAgle(this.mainWindowDispatcher);
// Creating ViewModel for all related pages
aglePageVM = new AglePageViewModel();
selfCheckingPageVM = new SelfCheckingPageViewModel();
titlePageVM = new TitlePageViewModel();
titlePageVM.VideoFinishedEvent += this.OnTitlePageFinished;
selfCheckingPageVM.AgleSystemStart += this.OnAgleSystemStart;
// Ready navigating to title page, show starting movie
TitlePage titlePage = new TitlePage();
titlePage.InitializeTitlePage(this.titlePageVM);
this.currentFrame.NavigationService.Navigate(titlePage);
}
示例3: MainWindowViewModel
public MainWindowViewModel(Frame frame)
{
MainFrame = frame;
Loaded = new RelayCommand(e => Loaded_Method());
SearchCommand = new RelayCommand(e => SearchCommand_Method());
AccountClick = new RelayCommand(e => AccountClick_Method());
}
示例4: SetRootFrame
public static void SetRootFrame(Frame rootFrame)
{
if (rootFrame == null)
throw new ArgumentNullException("rootFrame", "rootFrame cannot be null.");
_appRootFrame = rootFrame;
}
示例5: AddOption
private Button AddOption(string name, object source, string propertyName)
{
PageOptionItem pageOptionItem = new PageOptionItem();
pageOptionItem.buttonOption.Content = name;
Binding bd = new Binding(propertyName);
bd.Source = source;
bd.Mode = BindingMode.TwoWay;
pageOptionItem.labelOptionStatus.SetBinding(Label.IsEnabledProperty, bd);
pageOptionItem.buttonOption.Click +=
delegate(object sender, RoutedEventArgs e)
{
try
{
pageOptionItem.labelOptionStatus.IsEnabled =
!pageOptionItem.labelOptionStatus.IsEnabled;
}
catch
{
}
};
Frame frame = new Frame();
frame.Content = pageOptionItem;
stackPanel1.Children.Add(frame);
return pageOptionItem.buttonOption;
}
示例6: EnsureSampleAppApplication
public static SampleAppApplication EnsureSampleAppApplication(Frame navigationContext)
{
SampleAppNavigator.Instance.NavigationContext = navigationContext;
var app = SampleAppApplication.Instance ?? new SampleAppApplication(SampleAppNavigator.Instance);
app.UseDesignViewModels = false; // By default, UseDesignViewModels is true in Debug build and false otherwise. Since this app has a built-in mock service, we never use design data at runtime.
return app;
}
示例7: PhoneApplicationServiceAdapter
/// <summary>
/// Creates an instance of <see cref = "PhoneApplicationServiceAdapter" />.
/// </summary>
public PhoneApplicationServiceAdapter(Frame rootFrame) {
service = PhoneApplicationService.Current;
service.Launching += delegate { isResurrecting = false; };
service.Activated += delegate {
if(isResurrecting) {
Resurrecting();
NavigatedEventHandler onNavigated = null;
onNavigated = (s2, e2) => {
Resurrected();
rootFrame.Navigated -= onNavigated;
};
rootFrame.Navigated += onNavigated;
isResurrecting = false;
}
else {
Continuing();
NavigatedEventHandler onNavigated = null;
onNavigated = (s2, e2) => {
Continued();
rootFrame.Navigated -= onNavigated;
};
rootFrame.Navigated += onNavigated;
}
};
}
示例8: FrameNavigationService
public FrameNavigationService([NotNull] Frame frame)
{
Should.NotBeNull(frame, "frame");
_frame = frame;
_frame.Navigating += OnNavigating;
_frame.Navigated += OnNavigated;
}
示例9: SinglePage
/// <summary>
/// Erzeugt eine neue Seitenansicht mit einfacher Seite
/// </summary>
/// <param name="label">Titel der Seite</param>
/// <param name="page">Instanz der anzuzeigenden Seite</param>
public SinglePage(string label, KPage page)
{
MainWindow mainWindow = Application.Current.MainWindow as MainWindow;
Frame frame = new Frame();
Toolbar toolbar = new Toolbar(frame, page);
ScrollableFrame scrollableFrame = new ScrollableFrame();
ExtScrollViewer scrollViewer = scrollableFrame.createScrollableFrame(frame);
DockPanel.SetDock(toolbar.dpToolbarPanel, Dock.Top);
mainWindow.subNavigation.Children.Clear();
frame.Margin = new Thickness(15, 0, 0, 0);
frame.Content = page;
page.parentFrame = frame;
page.parentToolbar = toolbar;
page.parentScrollViewer = scrollViewer;
page.defineToolbarContent();
mainWindow.contentPanel.Children.Clear();
mainWindow.contentPanel.Children.Add(toolbar.dpToolbarPanel);
mainWindow.contentPanel.Children.Add(scrollViewer);
mainWindow.lbPageTitle.Content = label;
}
示例10: pConnect
public pConnect(Frame frame, ILogger log)
{
InitializeComponent();
MainFrame = frame;
logger = log;
pageConnect = this;
}
示例11: PanelAirlines
public PanelAirlines()
{
WrapPanel buttonsPanel = new WrapPanel();
// chs, 2011-18-10 added for different views / statistics for airlines
ucSelectButton sbFlights = new ucSelectButton();
sbFlights.Uid = "1001";
sbFlights.Content = Translator.GetInstance().GetString("PanelAirlines", sbFlights.Uid);
sbFlights.IsSelected = true;
sbFlights.Click += new System.Windows.RoutedEventHandler(sbFlights_Click);
buttonsPanel.Children.Add(sbFlights);
ucSelectButton sbFinancial = new ucSelectButton();
sbFinancial.Uid = "1002";
sbFinancial.Content = Translator.GetInstance().GetString("PanelAirlines", sbFinancial.Uid);
sbFinancial.Click += new System.Windows.RoutedEventHandler(sbFinancial_Click);
buttonsPanel.Children.Add(sbFinancial);
ucSelectButton sbFleet = new ucSelectButton();
sbFleet.Uid = "1003";
sbFleet.Content = Translator.GetInstance().GetString("PanelAirlines", sbFleet.Uid);
sbFleet.Click += new System.Windows.RoutedEventHandler(sbFleet_Click);
buttonsPanel.Children.Add(sbFleet);
this.Children.Add(buttonsPanel);
frameContent = new Frame();
frameContent.NavigationUIVisibility = NavigationUIVisibility.Hidden;
frameContent.Navigate(new PageAirlinesStatistics());
this.Children.Add(frameContent);
}
示例12: EnsureMainFrame
private bool EnsureMainFrame()
{
if (_mainFrame != null)
{
return true;
}
var mainPage = (Application.Current.RootVisual as MainPage);
if (mainPage != null)
{
_mainFrame = mainPage.NavigationFrame;
if (_mainFrame != null)
{
// Could be null if the app runs inside a design tool
_mainFrame.Navigating += (s, e) =>
{
if (Navigating != null)
{
Navigating(s, e);
}
};
return true;
}
}
return false;
}
示例13: MainWindow
public MainWindow()
{
InitializeComponent();
var uneFrame = new Frame();
MainGrid.Children.Add(uneFrame);
uneFrame.Navigate(new PageSwitcher());
}
示例14: SearchViewModel
public SearchViewModel(Frame frame,string name)
{
MainFrame = frame;
Name = name;
Load_Search();
SearchEnter = new RelayCommand(e => SearchEnter_Method());
}
示例15: switchPage
/// <summary>
/// Die anzuzeigende Seite wechseln
/// Erstellt neue Instanzen anstatt existierende wieder zu verwenden, da es Probleme mit dem .net Framework gab
/// </summary>
/// <param name="label">Der Titel der neuen Seite</param>
/// <param name="pageType">Der Typ der neuen Seite</param>
/// <param name="args">Parameter für den Konstruktor der neuen Seite</param>
public void switchPage(string label, Type pageType, params object[] args)
{
try
{
KPage page = (KPage)Activator.CreateInstance(pageType, args);
Frame frame = new Frame();
Toolbar toolbar = new Toolbar(frame, page);
ScrollableFrame scrollableFrame = new ScrollableFrame();
ExtScrollViewer extScrollViewer = scrollableFrame.createScrollableFrame(frame);
frame.Margin = new Thickness(15, 0, 0, 0);
DockPanel.SetDock(toolbar.dpToolbarPanel, Dock.Top);
frame.Content = page;
page.parentFrame = frame;
page.parentToolbar = toolbar;
page.parentScrollViewer = extScrollViewer;
page.defineToolbarContent();
this.contentPanel.Children.Clear();
this.contentPanel.Children.Add(toolbar.dpToolbarPanel);
this.contentPanel.Children.Add(extScrollViewer);
this.lbPageTitle.Content = label;
}
catch
{
}
}