Example #1
0
        public ErrorTemplatePageViewModel(INavigationService navigationService) : base(navigationService)
        {
            _navigationService     = navigationService;
            _applicationProperties = new ApplicationProperties();


            NavigateLoginPageCommand = new DelegateCommand(() =>

            {
                //ログイン済情報の削除
                _applicationProperties.ClearPropertie("userId");
                _applicationProperties.ClearPropertie("token");

                //ログインページに遷移させる
                _navigationService.NavigateAsync("/NavigationPage/LoginPage");
            });
        }
Example #2
0
        public void ApplicationProperties_ClearPropertie_Success()
        {
            MockForms.Init();
            Application.Current = new CustomApplication();
            Application.Current.Properties.Add("testClearKey", "testClearValue");

            var applicationProperties = new ApplicationProperties();

            applicationProperties.ClearPropertie("testClearKey");

            Assert.IsNull(applicationProperties.GetFromProperties <string>("testClearKey"));
        }