コード例 #1
0
        public void OnNavigatingFrom_With_ViewModel()
        {
            var viewModel = new MyViewModelNavigationAware();

            viewModel.Reset();

            NavigationHelper.OnNavigatingFrom(viewModel, new NavigationContext(typeof(MyViewModelNavigationAware), null));
            Assert.AreEqual(true, viewModel.IsOnNavigatingFromInvoked);
        }
コード例 #2
0
        public void OnNavigatedTo_With_ViewModel()
        {
            var viewModel = new MyViewModelNavigationAware();

            viewModel.Reset();

            NavigationHelper.OnNavigatedTo(viewModel, new NavigationContext(typeof(MyViewModelNavigationAware), "p"));
            Assert.AreEqual(true, viewModel.IsOnNavigatedToInvoked);
            Assert.AreEqual("p", viewModel.POnNavigatedTo);
        }