Ejemplo n.º 1
0
 private void NaviViewMain_SelectionChanged(NavigationView sender, NavigationViewSelectionChangedEventArgs args)
 {
     if (FirstClick)
     {
         FirstClick = false;
         FrameMain.Navigate(typeof(PageZajiao));
         FrameMain.Navigate(typeof(PageParent));
         if (NaviViewItemZajiao == sender.SelectedItem)
         {
             FrameMain.GoBack();
         }
     }
     else
     {
         if (sender.SelectedItem == CurrentItem)
         {
             return;
         }
         if (NaviViewItemZajiao == sender.SelectedItem)
         {
             FrameMain.GoBack();
         }
         if (NaviViewItemParent == sender.SelectedItem)
         {
             FrameMain.GoForward();
         }
     }
     CurrentItem = (NavigationViewItem)sender.SelectedItem;
 }
 private void BtnBack_Click(object sender, RoutedEventArgs e)
 {
     if (FrameMain.CanGoBack == true)
     {
         FrameMain.GoBack();
     }
 }
        public MainPage()
        {
            InitializeComponent();

            _updateElementsEvents.UpdateElementsEvent        += () => { UpdateFormElements(); };
            ChangeContentFrameEvents.ChangeContentFrameEvent +=
                (Type newPage, MainWindowFrame mainWindowFrame) =>
            {
                if (newPage == null)
                {
                    FrameMain.GoBack();
                }
                else
                {
                    ChangeFrameEvents(newPage, mainWindowFrame);
                }
            };
        }