Пример #1
0
 private void SetupAnkiModelView()
 {
     modelInformationViewModel        = new AnkiModelInfomartionViewModel(collection.Models.All());
     modelInformationView.DataContext = modelInformationViewModel.Models;
     modelInformationView.ChangeSelectedItem(currentNote.ModelId);
     modelInformationView.ComboBoxSelectionChangedEvent += ModelComboBoxSelectionChangedEventHandler;
     //Use this if need to disable multiple note types for a deck
     //modelInformationView.DisableModelSelection();
 }
Пример #2
0
 private void SetupAnkiModelView()
 {
     modelInformationViewModel        = new AnkiModelInfomartionViewModel(collection.Models.All());
     modelInformationView.DataContext = modelInformationViewModel.Models;
     modelInformationView.ChangeSelectedItem(currentNote.ModelId);
     modelInformationView.ComboBoxSelectionChangedEvent += ModelComboBoxSelectionChangedEventHandler;
     //Different with python and java ver, we do not allow user to change deck model
     modelInformationView.DisableModelSelection();
 }
        public CreateNewDeckFlyout(Collection collection, CoreDispatcher dispatcher)
        {
            this.InitializeComponent();
            this.collection = collection;
            this.dispatcher = dispatcher;

            modelViewModel        = new AnkiModelInfomartionViewModel(collection.Models.All());
            modelView.DataContext = modelViewModel.Models;
            modelView.Label       = "";
            modelView.ChangeSelectedIndex(0);

            addDeckFlyout.Closed += AddDeckFlyoutClosed;

            //A little hack to make sure combobox won't show when touchkey board is showing
            //If this is not done, white out error will happne on combobox
            InputPane.GetForCurrentView().Showing += TouchKeyboardShowingHandler;
            InputPane.GetForCurrentView().Hiding  += TouchKeyboardHidingHandler;
        }
Пример #4
0
        private void SetupAnkiModelView()
        {
            modelInformationView.ComboBoxSelectionChangedEvent -= ModelInformationViewComboBoxSelectionChangedEventHandler;
            modelViewModel = new AnkiModelInfomartionViewModel(collection.Models.All());
            modelInformationView.DataContext = modelViewModel.Models;

            var model = collection.Models.GetCurrent(false);

            if (model != null)
            {
                modelInformationView.ChangeSelectedItem((long)JsonHelper.GetNameNumber(model, "id"));
            }
            else
            {
                modelInformationView.ChangeSelectedIndex(0);
                collection.Models.SetCurrent(modelInformationView.GetSelectedModelId());
            }
            modelInformationView.ComboBoxSelectionChangedEvent += ModelInformationViewComboBoxSelectionChangedEventHandler;
            UpdateModelInformation();
        }