public void Delayed_CanActivate()
        {
            var  viewModel = new DelayedViewModel();
            bool?success   = null;

            viewModel.CActivate = false;
            success             = NavigationHelper.CanActivate(viewModel, new NavigationContext(typeof(MyViewModelCanActivate), "p")); // false
            Assert.AreEqual(false, success);

            viewModel.CActivate = true;
            success             = NavigationHelper.CanActivate(viewModel, new NavigationContext(typeof(MyViewModelCanActivate), "p2")); // true
            Assert.AreEqual(true, success);
        }
        public void CanActivate_ViewModel()
        {
            var  viewModel = new MyViewModelCanActivate();
            bool?success   = null;

            viewModel.Reset();
            viewModel.CActivate = false;
            success             = NavigationHelper.CanActivate(viewModel, new NavigationContext(typeof(MyViewModelCanActivate), "p")); // false
            Assert.AreEqual(true, viewModel.IsCanActivateInvoked);
            Assert.AreEqual("p", viewModel.P);
            Assert.AreEqual(false, success);

            viewModel.Reset();
            success = NavigationHelper.CanActivate(viewModel, new NavigationContext(typeof(MyViewModelCanActivate), "p2")); // true
            Assert.AreEqual(true, viewModel.IsCanActivateInvoked);
            Assert.AreEqual("p2", viewModel.P);
            Assert.AreEqual(true, success);
        }
        public void CanActivate_With_No_ViewModel_Not_Throw()
        {
            var  view    = new MyViewCanActivateWithoutContext();
            bool?success = null;

            view.Reset();
            view.CActivate = false;
            success        = NavigationHelper.CanActivate(view, new NavigationContext(typeof(MyViewCanActivateWithoutContext), "p")); // false
            Assert.AreEqual(true, view.IsCanActivateInvoked);
            Assert.AreEqual("p", view.P);
            Assert.AreEqual(false, success);

            view.Reset();
            success = NavigationHelper.CanActivate(view, new NavigationContext(typeof(MyViewCanActivateWithoutContext), "p2")); // true
            Assert.AreEqual(true, view.IsCanActivateInvoked);
            Assert.AreEqual("p2", view.P);
            Assert.AreEqual(true, success);
        }