Ejemplo n.º 1
0
        public StackTypeTestViewModel(string id, TimerViewModel testTimeViewModel, ISettings settings, int index)
        {
            Index    = index;
            Settings = settings;

            Initialize(id, testTimeViewModel);
        }
Ejemplo n.º 2
0
 public TestPageViewModel(string id, TimerViewModel testTimeViewModel, string time, ISettings settings, int index)
 {
     _settings          = settings;
     _settingsViewModel = new SettingsViewModel();
     _frameViewModel    = new FrameViewModel();
     Timer = testTimeViewModel ?? new TimerViewModel(TimeSpan.Parse(time), index);
     InitializeAsync(testTimeViewModel, id);
 }
Ejemplo n.º 3
0
 protected void DisableTimer()
 {
     if (Timer != null)
     {
         Timer.TimerModel.TimerIsVisible = false;
         Timer.Index = null;
         Timer       = null;
     }
 }
Ejemplo n.º 4
0
 private async void InitializeAsync(TimerViewModel testTimeViewModel, string id)
 {
     await Task.Run(() => {
         using (var realm = Realm.GetInstance())
         {
             var question = realm.Find <Question>(id);
             _settingsViewModel.SetSettingsModel(question.QuestionText, question.Price, question.Time);
             _frameViewModel.FillTestFrames(question.Contents, out _);
         }
     });
 }
Ejemplo n.º 5
0
        private async void Initialize(string questionId, TimerViewModel testTimeViewModel)
        {
            await Task.Run(() => {
                FrameViewModel    = new FrameViewModel();
                SettingsViewModel = new SettingsViewModel();

                using (var realm = Realm.GetInstance())
                {
                    var question = realm.Find <Question>(questionId);

                    SettingsViewModel.SetSettingsModel(question.QuestionText, question.Price, question.Time);
                    Timer = testTimeViewModel ?? new TimerViewModel(TimeSpan.Parse(question.Time), Index);

                    FillFramesAsync(question.Contents);
                }
            });
        }