示例#1
0
        private async Task LoadNote()
        {
            NoteViewModelBase viewModel = EmptyNoteVM;
            var mode = EndGame.Data.GetGameMode();
            var show = true;

            if (EndGame.Settings.Get(Strings.DeveloperMode).Bool)
            {
                EndGame.Logger.Debug($"MainView: DevMode enabled enabling note view");
                viewModel = NoteVM;
            }
            else if (ViewModelHelper.IsDeckAvailable())
            {
                EndGame.Logger.Debug($"MainView: Opponent deck is available");
                if (ViewModelHelper.IsModeEnabledForArchetypes(mode))
                {
                    EndGame.Logger.Debug($"MainView: note is enabled for {mode} mode");
                    viewModel = NoteVM;
                }
                else if (EndGame.Settings.Get(Strings.ShowRegularNoteBox).Bool)
                {
                    EndGame.Logger.Debug($"MainView: enabling regular note box");
                    viewModel = BasicNoteVM;
                }
                else
                {
                    EndGame.Logger.Debug($"MainView: no note dialog should be displayed");
                    // stop the view model being set and updated
                    show = false;
                }
            }

            if (show)
            {
                EndGame.Logger.Debug($"MainView: Updating view model");
                ContentViewModel = viewModel;
                await viewModel.Update();
            }
        }
示例#2
0
        private async Task LoadNote()
        {
            NoteViewModelBase viewModel = EmptyNoteVM;
            var mode = EndGame.Data.GetGameMode();

            if (IsDeckAvailable())
            {
                if (ViewModelHelper.IsModeEnabledForArchetypes(mode))
                {
                    viewModel = NoteVM;
                }
                else if (EndGame.Settings.Get(Strings.ShowRegularNoteBox).Bool)
                {
                    viewModel = BasicNoteVM;
                }
            }
            else if (EndGame.Settings.Get(Strings.DeveloperMode).Bool)
            {
                viewModel = NoteVM;
            }

            ContentViewModel = viewModel;
            await viewModel.Update();
        }