public void Constructor_SetsNavigationMode()
        {
            MockNavigationEntry navigationEntry = new MockNavigationEntry() { PageName = "SamplePage" };
            PageNavigationEventArgs eventArgs = new PageNavigationEventArgs(navigationEntry, NavigationMode.Forward);

            Assert.AreEqual(NavigationMode.Forward, eventArgs.NavigationMode);
        }
 public void Constructor_Exception_PageIsNull()
 {
     Assert.ThrowsException<ArgumentNullException>(() =>
         {
             PageNavigationEventArgs eventArgs = new PageNavigationEventArgs(null, NavigationMode.Forward);
         });
 }
        public void Constructor_SetsNavigationMode()
        {
            PageInfo navigationEntry = new PageInfo("SamplePage", null);
            PageNavigationEventArgs eventArgs = new PageNavigationEventArgs(navigationEntry, PageNavigationMode.Forward);

            Assert.Equal(PageNavigationMode.Forward, eventArgs.NavigationMode);
        }
        public void Constructor_Exception_InvalidNavigationMode()
        {
            MockNavigationEntry navigationEntry = new MockNavigationEntry() { PageName = "SamplePage" };

            Assert.ThrowsException<ArgumentException>(() =>
            {
                PageNavigationEventArgs eventArgs = new PageNavigationEventArgs(navigationEntry, (NavigationMode)100);
            });
        }
Example #5
0
        private void NavigationManager_NavigatedTo(object sender, PageNavigationEventArgs e)
        {
            // On first navigation with the navigation manager then register with the DataTransferManager
            // NB: The INavigationManager import should only be created on the main application view

            if (!isRegistered)
            {
                RegisterForSharing();
                isRegistered = true;
            }
        }
Example #6
0
        protected virtual void OnNavigatedTo(PageNavigationEventArgs args)
        {
            EventHandler<PageNavigationEventArgs> eventHandler = NavigatedTo;

            if (eventHandler != null)
                eventHandler(this, args);
        }
        // *** Mock Methods ***

        public void RaiseNavigatedTo(PageNavigationEventArgs eventArgs)
        {
            MockNavigationStack navigationStack = (MockNavigationStack)this.NavigationStack;
            navigationStack.RaiseNavigatedTo(eventArgs);
        }
Example #8
0
 public void RaiseNavigatingFrom(PageNavigationEventArgs eventArgs)
 {
     if (NavigatingFrom != null)
         NavigatingFrom(this, eventArgs);
 }
Example #9
0
        // *** Mock Methods ***

        public void RaiseNavigatedTo(PageNavigationEventArgs eventArgs)
        {
            if (NavigatedTo != null)
                NavigatedTo(this, eventArgs);
        }
Example #10
0
 private void navigationStack_PageDisposed(object sender, PageNavigationEventArgs e)
 {
     DisposePage(e.Page);
 }
Example #11
0
 private void navigationStack_NavigatingFrom(object sender, PageNavigationEventArgs e)
 {
     CallNavigatingFrom((PageInfo)e.Page, e.NavigationMode);
 }
Example #12
0
        // *** Event Handlers ***

        private void navigationStack_NavigatedTo(object sender, PageNavigationEventArgs e)
        {
            if (_restoringState)
                CallNavigatedTo((PageInfo)e.Page, PageNavigationMode.Refresh);
            else
                CallNavigatedTo((PageInfo)e.Page, e.NavigationMode);
        }