public void SetDataModel(IAnkiDeckOptionsViewModel data)
        {
            viewModel = data as DeckLapseOptionsViewModel;
            if (viewModel == null)
            {
                throw new Exception("Wrong datatype. Expected datatype: DeckLapseOptionsViewModel");
            }

            delaysTextBox.Text = viewModel.Options.Delays;
            viewModel.Options.PropertyChanged += Options_PropertyChanged;
        }
Exemplo n.º 2
0
        private void InitExpertOptionTabs()
        {
            if (rootTab == null)
            {
                FindName("rootTab");
                generalConfig = new DeckGeneralOptionsViewModel(config);
                newConfig     = new DeckNewOptionsViewModel(config);
                reviewConfig  = new DeckReviewOptionsViewModel(config);
                lapseConfig   = new DeckLapseOptionsViewModel(config);
            }

            Options.Add(generalConfig, generalView);
            Options.Add(newConfig, newView);
            Options.Add(reviewConfig, reviewView);
            Options.Add(lapseConfig, lapseView);

            foreach (var option in Options)
            {
                option.Key.GetOptionsToView();
                option.Value.SetDataModel(option.Key);
            }
        }