本文整理汇总了C#中System.Windows.Controls.Frame.Navigate方法的典型用法代码示例。如果您正苦于以下问题:C# Frame.Navigate方法的具体用法?C# Frame.Navigate怎么用?C# Frame.Navigate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Controls.Frame
的用法示例。
在下文中一共展示了Frame.Navigate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PanelFleetAirliner
public PanelFleetAirliner(FleetAirliner airliner)
{
this.Airliner = airliner;
WrapPanel buttonsPanel = new WrapPanel();
ucSelectButton sbFacilities = new ucSelectButton();
sbFacilities.Content = Translator.GetInstance().GetString("PanelFleetAirliner","200");
sbFacilities.IsSelected = this.Airliner.Airliner.Type.TypeAirliner == AirlinerType.TypeOfAirliner.Passenger;
sbFacilities.Click += new System.Windows.RoutedEventHandler(sbFacilities_Click);
sbFacilities.Visibility = this.Airliner.Airliner.Type.TypeAirliner == AirlinerType.TypeOfAirliner.Passenger ? System.Windows.Visibility.Visible : System.Windows.Visibility.Collapsed;
buttonsPanel.Children.Add(sbFacilities);
ucSelectButton sbRoute = new ucSelectButton();
sbRoute.Content = Translator.GetInstance().GetString("PanelFleetAirliner","201");
sbRoute.IsSelected = this.Airliner.Airliner.Type.TypeAirliner != AirlinerType.TypeOfAirliner.Passenger;
sbRoute.Click += new System.Windows.RoutedEventHandler(sbRoute_Click);
buttonsPanel.Children.Add(sbRoute);
ucSelectButton sbTimeSlot = new ucSelectButton();
sbTimeSlot.Content = Translator.GetInstance().GetString("PanelFleetAirliner","202");
sbTimeSlot.Visibility = System.Windows.Visibility.Collapsed;
sbTimeSlot.Click += new System.Windows.RoutedEventHandler(sbTimeSlot_Click);
buttonsPanel.Children.Add(sbTimeSlot);
ucSelectButton sbStatistics = new ucSelectButton();
sbStatistics.Content = Translator.GetInstance().GetString("PanelFleetAirliner","203");
sbStatistics.Click += new System.Windows.RoutedEventHandler(sbStatistics_Click);
buttonsPanel.Children.Add(sbStatistics);
ucSelectButton sbMaintenance = new ucSelectButton();
sbMaintenance.Content = Translator.GetInstance().GetString("PanelFleetAirliner","205");
sbMaintenance.Visibility = this.Airliner.Airliner.Airline.IsHuman ? Visibility.Visible : System.Windows.Visibility.Collapsed;
sbMaintenance.Click +=sbMaintenance_Click;
buttonsPanel.Children.Add(sbMaintenance);
ucSelectButton sbInsurance = new ucSelectButton();
sbInsurance.Content = Translator.GetInstance().GetString("PanelFleetAirliner", "204");
sbInsurance.Visibility = this.Airliner.Airliner.Airline.IsHuman ? Visibility.Visible : Visibility.Collapsed;
sbInsurance.Click+=sbInsurance_Click;
buttonsPanel.Children.Add(sbInsurance);
this.Children.Add(buttonsPanel);
frameContent = new Frame();
frameContent.NavigationUIVisibility = NavigationUIVisibility.Hidden;
if (this.Airliner.Airliner.Type.TypeAirliner == AirlinerType.TypeOfAirliner.Passenger)
frameContent.Navigate(new PageFleetFacilities(this.Airliner));
else
frameContent.Navigate(new PageFleetRoute(this.Airliner));
this.Children.Add(frameContent);
}
示例2: PanelAirports
public PanelAirports(PageAirports parent)
{
this.ParentPage = parent;
WrapPanel buttonsPanel = new WrapPanel();
ucSelectButton sbSearch = new ucSelectButton();
sbSearch.Uid = "201";
sbSearch.Content = Translator.GetInstance().GetString("PanelAirports", sbSearch.Uid);
sbSearch.IsSelected = true;
sbSearch.Click += new System.Windows.RoutedEventHandler(sbSearch_Click);
buttonsPanel.Children.Add(sbSearch);
ucSelectButton sbExtendedSearch = new ucSelectButton();
sbExtendedSearch.Uid = "203";
sbExtendedSearch.Content = Translator.GetInstance().GetString("PanelAirports", sbExtendedSearch.Uid);
sbExtendedSearch.Click += new System.Windows.RoutedEventHandler(sbExtendedSearch_Click);
buttonsPanel.Children.Add(sbExtendedSearch);
ucSelectButton sbStatistics = new ucSelectButton();
sbStatistics.Uid = "202";
sbStatistics.Content = Translator.GetInstance().GetString("PanelAirports", sbStatistics.Uid);
sbStatistics.Click += new System.Windows.RoutedEventHandler(sbStatistics_Click);
buttonsPanel.Children.Add(sbStatistics);
this.Children.Add(buttonsPanel);
frameContent = new Frame();
frameContent.NavigationUIVisibility = NavigationUIVisibility.Hidden;
frameContent.Navigate(new PageSearchAirports(this.ParentPage));
this.Children.Add(frameContent);
}
示例3: MainWindow
public MainWindow()
{
InitializeComponent();
var uneFrame = new Frame();
MainGrid.Children.Add(uneFrame);
uneFrame.Navigate(new PageSwitcher());
}
示例4: 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);
}
示例5: App
App()
{
Window mainWindow = new MainWindow();
Frame rootFrame = new Frame();
// Plugin
Page page = new Page1();
rootFrame.Navigate(page, null);
mainWindow.Content = rootFrame;
mainWindow.Show();
}
示例6: MainWindow
public MainWindow()
{
InitializeComponent();
StaticParams.ScreenWidth = System.Windows.SystemParameters.PrimaryScreenWidth;
StaticParams.ScreenHeight = System.Windows.SystemParameters.PrimaryScreenHeight;
Main.Width = ScreenWidth;
Main.Height = ScreenHeight;
MainFrame = new Frame();
MainFrame.NavigationUIVisibility = NavigationUIVisibility.Hidden;
Main.AddChild(MainFrame);
MainFrame.Navigate(new LoginPage());
}
示例7: StandardPage
public StandardPage()
{
if (GameObject.GetInstance().PagePerformanceCounterEnabled)
{
sw = new Stopwatch();
sw.Start();
this.Loaded += new RoutedEventHandler(StandardPage_Loaded);
}
this.Width = SystemParameters.PrimaryScreenWidth;
this.Height = SystemParameters.PrimaryScreenHeight;
int sideMargin = 200;
int regularMargin = 25;
int menuHeight = 25;
int bottomMenuHeight = 25;
ImageBrush imgBackground = new ImageBrush();
BitmapImage img = (BitmapImage)App.Current.Resources["BackgroundImage"];
imgBackground.ImageSource = (BitmapImage)FindResource("BackgroundImage");
imgBackground.Viewport = new Rect(0, 0, this.Width, this.Height);
imgBackground.ViewportUnits = BrushMappingMode.Absolute;
imgBackground.TileMode = TileMode.Tile;
this.Background = imgBackground;
mainPanel = new Canvas();
frameTopMenu = new Frame();
frameTopMenu.Height = menuHeight;
frameTopMenu.Width = this.Width;
frameTopMenu.NavigationUIVisibility = NavigationUIVisibility.Hidden;
frameTopMenu.Navigate(new PageStandardMenuTop());
Canvas.SetTop(frameTopMenu, 0);
Canvas.SetLeft(frameTopMenu, 0);
mainPanel.Children.Add(frameTopMenu);
panelNavigation = new DockPanel();
panelNavigation.Margin = new Thickness(0, 5, 0, 0);
btnPrevious = new Button();
btnPrevious.SetResourceReference(Button.StyleProperty, "RoundedButton");
btnPrevious.Height = 24;
btnPrevious.Width = 32;
btnPrevious.Content = "<-";
btnPrevious.Margin = new Thickness(2, 0, 0, 0);
btnPrevious.SetResourceReference(Button.BackgroundProperty, "ButtonBrush");
btnPrevious.Click += new RoutedEventHandler(btnPrevious_Click);
panelNavigation.Children.Add(btnPrevious);
btnPrevious.ToolTip = UICreator.CreateToolTip("1001");
btnNext = new Button();
btnNext.SetResourceReference(Button.StyleProperty, "RoundedButton");
btnNext.Height = 24;
btnNext.Margin = new Thickness(2, 0, 0, 0);
btnNext.Width = 32;
btnNext.Content = "->";
btnNext.SetResourceReference(Button.BackgroundProperty, "ButtonBrush");
btnNext.Click += new RoutedEventHandler(btnNext_Click);
panelNavigation.Children.Add(btnNext);
btnNext.ToolTip = UICreator.CreateToolTip("1002");
btnPause = new Button();
btnPause.SetResourceReference(Button.StyleProperty, "RoundedButton");
btnPause.Height = 24;
btnPause.Width = 32;
btnPause.Margin = new Thickness(2, 0, 0, 0);
btnPause.Content = "||";
btnPause.Visibility = GameTimer.GetInstance().isPaused() ? Visibility.Collapsed : Visibility.Visible;
btnPause.SetResourceReference(Button.BackgroundProperty, "ButtonBrush");
btnPause.Click += new RoutedEventHandler(btnPause_Click);
panelNavigation.Children.Add(btnPause);
btnPause.ToolTip = UICreator.CreateToolTip("1003");
btnStart = new Button();
btnStart.SetResourceReference(Button.StyleProperty, "RoundedButton");
btnStart.Height = 24;
btnStart.Width = 32;
btnStart.Visibility = GameTimer.GetInstance().isPaused() ? Visibility.Visible : System.Windows.Visibility.Collapsed;
btnStart.Margin = new Thickness(2, 0, 0, 0);
btnStart.Content = ">";
btnStart.SetResourceReference(Button.BackgroundProperty, "ButtonBrush");
btnStart.Click += new RoutedEventHandler(btnStart_Click);
panelNavigation.Children.Add(btnStart);
btnStart.ToolTip = UICreator.CreateToolTip("1004");
Button btnThreadState = new Button();
btnThreadState.Visibility = System.Windows.Visibility.Collapsed;
btnThreadState.SetResourceReference(Button.StyleProperty, "RoundedButton");
btnThreadState.Height = Double.NaN;
btnThreadState.Width = Double.NaN;
btnThreadState.Margin = new Thickness(2, 0, 0, 0);
btnThreadState.Content = "Thread state";
btnThreadState.SetResourceReference(Button.BackgroundProperty, "ButtonBrush");
btnThreadState.Click += btnThreadState_Click;
//.........这里部分代码省略.........
示例8: AddSearchTab
/// <summary>
/// Add a new search tab to the tab control
/// </summary>
private void AddSearchTab()
{
try
{
CloseableTabItem cti = new CloseableTabItem();
cti.Header = "New Search " + _searchNumber.ToString(CultureInfo.CurrentCulture);
_searchNumber++;
Grid g = new Grid();
Frame f = new Frame();
SearchView sv = new SearchView();
SearchViewModel svm = sv.DataContext as SearchViewModel;
if (!string.IsNullOrEmpty(Properties.Settings.Default.SavedSearch))
{
MemoryStream ms = new MemoryStream(Encoding.ASCII.GetBytes(Properties.Settings.Default.SavedSearch));
XmlSerializer xml = new XmlSerializer(typeof(DrawingSearchModel));
DrawingSearchModel dsm = xml.Deserialize(ms) as DrawingSearchModel;
svm.Model = dsm;
}
f.Navigate(sv);
g.Children.Add(f);
cti.Content = g;
tabControl1.Items.Add(cti);
tabControl1.SelectedItem = cti;
}
catch (Exception ex)
{ MessageBox.Show(ex.ToString()); }
}
示例9: PanelAirport
public PanelAirport(Airport airport)
{
Stopwatch sw = new Stopwatch();
sw.Start();
this.Airport = airport;
WrapPanel buttonsPanel = new WrapPanel();
ucSelectButton sbGates = new ucSelectButton();
sbGates.Uid = "201";
sbGates.Content = Translator.GetInstance().GetString("PanelAirport", sbGates.Uid);
sbGates.Click += new System.Windows.RoutedEventHandler(sbGates_Click);
sbGates.IsSelected = true;
buttonsPanel.Children.Add(sbGates);
ucSelectButton sbRunways = new ucSelectButton();
sbRunways.Uid = "205";
sbRunways.Content = Translator.GetInstance().GetString("PanelAirport", sbRunways.Uid);
sbRunways.Click += new System.Windows.RoutedEventHandler(sbRunways_Click);
buttonsPanel.Children.Add(sbRunways);
ucSelectButton sbFacilities = new ucSelectButton();
sbFacilities.Uid = "202";
sbFacilities.Content = Translator.GetInstance().GetString("PanelAirport", sbFacilities.Uid);
sbFacilities.Click += new System.Windows.RoutedEventHandler(sbFacilities_Click);
buttonsPanel.Children.Add(sbFacilities);
ucSelectButton sbWeather = new ucSelectButton();
sbWeather.Uid = "208";
sbWeather.Content = Translator.GetInstance().GetString("PanelAirport", sbWeather.Uid);
sbWeather.Click += new System.Windows.RoutedEventHandler(sbWeather_Click);
buttonsPanel.Children.Add(sbWeather);
ucSelectButton sbStatistics = new ucSelectButton();
sbStatistics.Uid = "203";
sbStatistics.Content = Translator.GetInstance().GetString("PanelAirport", sbStatistics.Uid);
sbStatistics.Click += new System.Windows.RoutedEventHandler(sbStatistics_Click);
buttonsPanel.Children.Add(sbStatistics);
ucSelectButton sbTraffic = new ucSelectButton();
sbTraffic.Uid = "207";
sbTraffic.Content = Translator.GetInstance().GetString("PanelAirport", sbTraffic.Uid);
sbTraffic.Click += new System.Windows.RoutedEventHandler(sbTraffic_Click);
buttonsPanel.Children.Add(sbTraffic);
ucSelectButton sbFlights = new ucSelectButton();
sbFlights.Uid = "204";
sbFlights.Content = Translator.GetInstance().GetString("PanelAirport", sbFlights.Uid);
sbFlights.Click += new System.Windows.RoutedEventHandler(sbFlights_Click);
buttonsPanel.Children.Add(sbFlights);
ucSelectButton sbDistances = new ucSelectButton();
sbDistances.Uid = "206";
sbDistances.Content = Translator.GetInstance().GetString("PanelAirport",sbDistances.Uid);
sbDistances.Click += new System.Windows.RoutedEventHandler(sbDistances_Click);
buttonsPanel.Children.Add(sbDistances);
this.Children.Add(buttonsPanel);
frameContent = new Frame();
frameContent.NavigationUIVisibility = NavigationUIVisibility.Hidden;
frameContent.Navigate(new PageAirportGates(this.Airport));
this.Children.Add(frameContent);
sw.Stop();
PerformanceCounters.AddPerformanceCounter(new PagePerformanceCounter("PanelAirport", GameObject.GetInstance().GameTime, sw.ElapsedMilliseconds));
}
示例10: navigateInfo
private void navigateInfo(Frame frame)
{
removeListener();
Info info = new Info();
_infoTab.Content = info;
frame.Navigate(info);
_lastPage = info;
}
示例11: GoToReadBooks
private void GoToReadBooks(Frame BookShelfPageFrame)
{
BookShelfPageFrame.Navigate(new Uri("ReadBooks.xaml", UriKind.Relative));
}
示例12: navigateWeight
private void navigateWeight(Frame frame)
{
removeListener();
_wc.updateChart();
frame.Navigate(_wc);
_lastPage = _wc;
}
示例13: navigateMovement
private void navigateMovement(Frame frame)
{
removeListener();
Movement movement = new Movement();
_movementTab.Content = movement;
frame.Navigate(movement);
_lastPage = movement;
}
示例14: navigateMarble
private void navigateMarble(Frame frame)
{
removeListener();
Marble mb = new Marble();
frame.Navigate(mb);
_lastPage = mb;
}
示例15: PanelAirline
public PanelAirline(Airline airline,StandardPage parent)
{
this.Airline = airline;
this.PageParent = parent;
WrapPanel buttonsPanel = new WrapPanel();
ucSelectButton sbFleet = new ucSelectButton();
sbFleet.Uid = "1001";
sbFleet.Content = Translator.GetInstance().GetString("PanelAirline", sbFleet.Uid);
sbFleet.IsSelected = true;
sbFleet.Click += new System.Windows.RoutedEventHandler(sbFleet_Click);
buttonsPanel.Children.Add(sbFleet);
ucSelectButton sbDestinations = new ucSelectButton();
sbDestinations.Uid = "1002";
sbDestinations.Content = Translator.GetInstance().GetString("PanelAirline", sbDestinations.Uid);
sbDestinations.Click += new System.Windows.RoutedEventHandler(sbDestinations_Click);
buttonsPanel.Children.Add(sbDestinations);
ucSelectButton sbPilots = new ucSelectButton();
sbPilots.Uid = "1008";
sbPilots.Content = Translator.GetInstance().GetString("PanelAirline", sbPilots.Uid);
sbPilots.Click += sbPilots_Click;
buttonsPanel.Children.Add(sbPilots);
ucSelectButton sbStatistics = new ucSelectButton();
sbStatistics.Uid = "1004";
sbStatistics.Click += new System.Windows.RoutedEventHandler(sbStatistics_Click);
sbStatistics.Content = Translator.GetInstance().GetString("PanelAirline", sbStatistics.Uid);
buttonsPanel.Children.Add(sbStatistics);
ucSelectButton sbFinances = new ucSelectButton();
sbFinances.Uid = "1005";
sbFinances.Content = Translator.GetInstance().GetString("PanelAirline", sbFinances.Uid);
sbFinances.Click += new System.Windows.RoutedEventHandler(sbFinances_Click);
buttonsPanel.Children.Add(sbFinances);
ucSelectButton sbSubsidiary = new ucSelectButton();
sbSubsidiary.Uid = "1007";
sbSubsidiary.Content = Translator.GetInstance().GetString("PanelAirline", sbSubsidiary.Uid);
sbSubsidiary.Click += new System.Windows.RoutedEventHandler(sbSubsidiary_Click);
sbSubsidiary.Visibility = this.Airline is SubsidiaryAirline ? System.Windows.Visibility.Collapsed : System.Windows.Visibility.Visible;
buttonsPanel.Children.Add(sbSubsidiary);
ucSelectButton sbWages = new ucSelectButton();
sbWages.Uid = "1006";
sbWages.Content = Translator.GetInstance().GetString("PanelAirline", sbWages.Uid);
sbWages.Visibility = this.Airline.IsHuman ? System.Windows.Visibility.Visible : System.Windows.Visibility.Collapsed;
sbWages.Click += new System.Windows.RoutedEventHandler(sbWages_Click);
buttonsPanel.Children.Add(sbWages);
ucSelectButton sbInsurances = new ucSelectButton();
sbInsurances.Uid = "1009";
sbInsurances.Content = Translator.GetInstance().GetString("PanelAirline", sbInsurances.Uid);
sbInsurances.Visibility = this.Airline.IsHuman ? System.Windows.Visibility.Visible : System.Windows.Visibility.Collapsed;
sbInsurances.Click += sbInsurances_Click;
buttonsPanel.Children.Add(sbInsurances);
this.Children.Add(buttonsPanel);
frameContent = new Frame();
frameContent.NavigationUIVisibility = NavigationUIVisibility.Hidden;
frameContent.Navigate(new PageAirlineFleet(this.Airline));
this.Children.Add(frameContent);
}