public MasterDetailPage()
 {
     this.InitializeComponent();
     Current = this;
     ViewModel.PropertyChanged += ViewModel_PropertyChanged;
     MasterFrame.Navigate(typeof(ArticleView));
 }
Exemplo n.º 2
0
 private void Page_Loaded(object sender, RoutedEventArgs e)
 {
     MasterFrame.Navigate(typeof(View.MasterView));
     (MasterFrame.Content as View.MasterView).NavigatingToAccount += TimeLinePage_NavigatingToAccount;
     DetailFrame.Navigate(typeof(View.StandByView));
     Windows.UI.Core.SystemNavigationManager.GetForCurrentView().BackRequested += BackRequested;
     DetailFrame.Navigated += DetailFrame_Navigated;
 }
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            string navItemTag = e.Parameter as string;

            if (navItemTag == "home")
            {
                MasterFrame.Navigate(typeof(ArticleView));
            }
        }
Exemplo n.º 4
0
        public MasterDetailPage()
        {
            this.InitializeComponent();
            this.DataContext = ViewModel;
            MasterFrame.Navigate(typeof(ConversationListPage));
            ViewModel.PropertyChanged += ViewModel_PropertyChanged;

            detailFrame = this.AdaptiveStates.CurrentState == NarrowState ? MasterFrame : DetailFrame;
        }
Exemplo n.º 5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="e"></param>
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            var viewType = e.Parameter as Type;

            if (viewType != null && MasterFrame.CurrentSourcePageType != viewType)
            {
                MasterFrame.Navigate(viewType);
            }
            //UpdateForVisualState(AdaptiveStates.CurrentState);
        }
Exemplo n.º 6
0
        private bool NavigateToView(string clickedView)
        {
            var view = Assembly.GetExecutingAssembly()
                       .GetType($"NavigationView.Views.{clickedView}");

            if (string.IsNullOrWhiteSpace(clickedView) || view == null)
            {
                return(false);
            }

            MasterFrame.Navigate(view, null, new EntranceNavigationTransitionInfo());
            return(true);
        }
Exemplo n.º 7
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            if (e.Parameter is Type)
            {
                var viewType = e.Parameter as Type;
                MasterFrame.Navigate(viewType);
                if (AdaptiveStates.CurrentState == DefaultState)
                {
                    DetailFrame.Navigate(typeof(ConversationPage));
                }
            }
        }
Exemplo n.º 8
0
        private void NavViewControl_ItemInvoked(NavigationView sender, NavigationViewItemInvokedEventArgs args)
        {
            var item = args.InvokedItemContainer as NavigationViewItem;

            switch (item.Tag.ToString())
            {
            case "MyCalendar":
                MasterFrame.Navigate(typeof(My_Calendar));
                NavViewControl.Header = "My Calendar";
                break;

            case "MyLessons":
                MasterFrame.Navigate(typeof(My_Lessons));
                NavViewControl.Header = "My Lessons";
                break;

            case "MyEvents":
                MasterFrame.Navigate(typeof(My_Events));
                NavViewControl.Header = "My Events";
                break;

            case "MyReminders":
                MasterFrame.Navigate(typeof(My_Reminders));
                NavViewControl.Header = "My Reminders";
                break;
            }

            if (item == null || item == navigationViewItem)
            {
                return;
            }
            var clickedView = item.Tag?.ToString() ?? "Settings";

            if (!NavigateToView(clickedView))
            {
                return;
            }
            navigationViewItem = item;
        }
Exemplo n.º 9
0
        public App_Root()
        {
            this.InitializeComponent();


            Current = this;
            MasterFrame.Navigate(typeof(My_Calendar));
            NavViewControl.Header = "My Calendar";

            CoreApplication.GetCurrentView().TitleBar.LayoutMetricsChanged += (s, e) => UpdateAppTitle(s);

            void UpdateAppTitle(CoreApplicationViewTitleBar coreTitleBar)
            {
                var full = (ApplicationView.GetForCurrentView().IsFullScreenMode);
                var left = 12 + (full ? 0 : coreTitleBar.SystemOverlayLeftInset);

                AppTitle.Margin    = new Thickness(left, 8, 0, 0);
                AppTitleBar.Height = coreTitleBar.Height;
            }

            // Add keyboard accelerators for backwards navigation.
            KeyboardAccelerator GoBack = new KeyboardAccelerator
            {
                Key = VirtualKey.GoBack
            };
            KeyboardAccelerator AltLeft = new KeyboardAccelerator
            {
                Key = VirtualKey.Left
            };

            this.KeyboardAccelerators.Add(GoBack);
            this.KeyboardAccelerators.Add(AltLeft);
            // ALT routes here
            AltLeft.Modifiers = VirtualKeyModifiers.Menu;

            _isKeyboardConnected = Convert.ToBoolean(new KeyboardCapabilities().KeyboardPresent);
        }
Exemplo n.º 10
0
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     MasterFrame.Navigate(typeof(CollectionPage));
     DetailFrame.Navigate(typeof(GalleryPage));
 }