コード例 #1
0
 internal void NullifyViewModels()
 {
     _randomizerView = null;
     _signInView     = null;
     _signUpView     = null;
     _archiveView    = null;
 }
コード例 #2
0
        internal void Navigate(ModesEnum mode, BaseViewModel viewModel)
        {
            switch (mode)
            {
            case ModesEnum.Randomizer:
                _contentWindow.ContentControl.Content = _randomizerView ?? (_randomizerView = new RandomizerView());
                break;

            case ModesEnum.SignIn:
                _contentWindow.ContentControl.Content = _signInView ?? (_signInView = new SignInView());
                break;

            case ModesEnum.SignUp:
                _contentWindow.ContentControl.Content = _signUpView ?? (_signUpView = new SignUpView());
                break;

            case ModesEnum.Archive:
                _contentWindow.ContentControl.Content = _archiveView ?? (_archiveView = new ArchiveView(viewModel));
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(mode), mode, null);
            }
        }