Beispiel #1
0
        private async void ModelComboBoxSelectionChangedEventHandler(object sender, SelectionChangedEventArgs e)
        {
            var comboBox = sender as ComboBox;
            var selected = comboBox.SelectedItem as AnkiModelInformation;

            if (suppressModelComboboxSelectionChangeEvent)
            {
                suppressModelComboboxSelectionChangeEvent = false;
                return;
            }

            bool isContinue = await UIHelper.AskUserConfirmation("Changing note type will reset all your inputs. Continue?");

            if (!isContinue)
            {
                ChangeSelectedModel(currentNote.ModelId);
                return;
            }

            SetupDeckModel(selected.Id);
            noteFieldView.HtmlEditor.ReloadWebView();
            await UpdateCurrentNote();

            fieldListView = null;
        }
Beispiel #2
0
 private void InitFieldListViewIfNeeded()
 {
     if (fieldListView == null)
     {
         fieldListView = new FieldListView();
         fieldListView.SetDataContext(noteFieldView.fieldsViewModel);
         fieldListView.FieldClickEvent += FieldListViewClickEventHandler;
     }
 }
Beispiel #3
0
 private void InitFlyoutAndViewModelIfNeeded()
 {
     if (fieldListView == null)
     {
         fieldListView       = new FieldListView();
         noteFieldsViewModel = new NoteFieldsViewModel(templateInformationView.ViewModel.CurrentModel);
         fieldListView.SetDataContext(noteFieldsViewModel);
         fieldListView.FieldClickEvent += FieldFlyoutButtonClickHandler;
     }
 }