コード例 #1
0
        public MainViewModel(Dispatcher dispatcher)
        {
            _dispatcher = dispatcher;
            _loggedOutViewModel = new LoggedOutViewModel(dispatcher);
            _loggedOutViewModel.OnLoginSuccess += _loggedOutViewModel_LoginSuccess;

            if (Configuration.Instance.HasLoginCredentials)
            {
                _loggedInViewModel = new LoggedInViewModel();
                _loggedInViewModel.OnLoggedOut += _loggedInViewModel_LoggedOut;
            }

            this.CurrentView = Configuration.Instance.HasLoginCredentials ? (object)_loggedInViewModel : _loggedOutViewModel;
        }
コード例 #2
0
 private void _loggedOutViewModel_LoginSuccess()
 {
     _loggedInViewModel = new LoggedInViewModel();
     this.CurrentView = _loggedInViewModel;
 }