示例#1
0
        public QuizModeViewModel(IWindowManager windowManager, ConnectionToDBModel db)
        {
            this._windowManager = windowManager;
            GUIstringsModel strings = new GUIstringsModel();

            this.DescriptionLabel           = strings.GetGUIstr("DescriptionLabel");
            this.AvailableTestsLabel        = strings.GetGUIstr("AvailableTestsLabel");
            this.NumberOfQuestionsLabel     = strings.GetGUIstr("NumberOfQuestionsLabel");
            this.StartQuizButton            = strings.GetGUIstr("StartQuizButton");
            this.QuestionNumberForQuizLabel = strings.GetGUIstr("QuestionNumberForQuizLabel");
            this.PercentToPassLabel         = strings.GetGUIstr("PercentToPassLabel");
            this.TimeLabel = strings.GetGUIstr("TimeLabel");

            Task.Run(() =>
            {
                this.Tests = db.GetTests();
                this.Refresh();
            });

            this.QuestionNumberForQuizFieldBackground = "White";
            this.PercentToPassFieldBackground         = "White";
            this.TimeFieldBackground = "White";
            this.StartQuizIsEnabled  = "False";

            this.QuestionNumberForQuizFieldIsEnabled = "False";
            this.PercentToPassFieldIsEnabled         = "False";
            this.TimeFieldIsEnabled = "False";
        }
        public EditQuestionPopUpViewModel(ConnectionToDBModel db, EventAggregator eventAggregator, QuestionModel selectedQuestion)
        {
            this._selectedQuestion = selectedQuestion;
            this._db = db;
            this._eventAggregator = eventAggregator;

            this.Answers = new BindableCollection <AnswerModel>();
            foreach (AnswerModel a in selectedQuestion.Answers)
            {
                this.Answers.Add(new AnswerModel(a.IdDB, a.Answer, a.Correct));
            }
            this.QuestionTextValue = selectedQuestion.QuestionText;

            this._readyToRead = false;

            GUIstringsModel strings = new GUIstringsModel();

            this.EditQuestionOnView   = strings.GetGUIstr("EditQuestionOnView");
            this.AnswersLabel         = strings.GetGUIstr("AnswersLabel");
            this.AnswerTextLabel      = strings.GetGUIstr("AnswerTextLabel");
            this.IsCorrectLabel       = strings.GetGUIstr("IsCorrectLabel");
            this.ConfirmEditionButton = strings.GetGUIstr("ConfirmEditionButton");
            this.QuestionTextLabel    = strings.GetGUIstr("QuestionTextLabel");
            this.DeleteAnswerButton   = strings.GetGUIstr("DeleteAnswerButton");
            this.NewAnswerButton      = strings.GetGUIstr("NewAnswerButton");
            this.NewAnswerValueString = strings.GetGUIstr("NewAnswerValueString");
        }
示例#3
0
        public LearnModeViewModel(IWindowManager windowManager, ConnectionToDBModel db)
        {
            this._windowManager = windowManager;
            GUIstringsModel strings = new GUIstringsModel();

            this.DescriptionLabel       = strings.GetGUIstr("DescriptionLabel");
            this.AvailableTestsLabel    = strings.GetGUIstr("AvailableTestsLabel");
            this.NumberOfQuestionsLabel = strings.GetGUIstr("NumberOfQuestionsLabel");
            this.StartLearningButton    = strings.GetGUIstr("StartLearningButton");

            Task.Run(() =>
            {
                this.Tests = db.GetTests();
                this.Refresh();
            });

            this.StartLearnButtonIsEnabled = "False";
        }
        public EditTestPopUpViewModel(ConnectionToDBModel db, EventAggregator eventAggregator, TestModel selectedTest)
        {
            this._db              = db;
            this._selectedTest    = selectedTest;
            this._eventAggregator = eventAggregator;

            this._eventAggregator.Subscribe(this);

            this.Questions = new BindableCollection <QuestionModel>();
            Task.Run(() =>
            {
                var taskDB     = db.GetQuestions();
                this.Questions = taskDB;
                foreach (QuestionModel q in this.Questions)
                {
                    foreach (QuestionModel qTest in this._selectedTest.Questions)
                    {
                        if (q.IdDB == qTest.IdDB)
                        {
                            q.IsSelected = true;
                        }
                    }
                }
                this.Refresh();
            });

            this._readyToRead = false;

            GUIstringsModel strings = new GUIstringsModel();

            this.EditTestTitle        = strings.GetGUIstr("EditTestTitle");
            this.QuestionsInTestLabel = strings.GetGUIstr("QuestionsInTestLabel");
            this.ConfirmEditionButton = strings.GetGUIstr("ConfirmEditionButton");
            this.TitleLabel           = strings.GetGUIstr("TitleLabel");
            this.DescriptionLabel     = strings.GetGUIstr("DescriptionLabel");

            this.TitleValue       = this._selectedTest.Title;
            this.DescriptionValue = this._selectedTest.Description;

            ConfirmButtonTryToEnable();
        }
示例#5
0
        public ShellViewModel()
        {
            this._eventAggregator = new EventAggregator();
            this._windowManager   = new WindowManager();
            this._db = new ConnectionToDBModel(_eventAggregator);
            GUIstringsModel strings = new GUIstringsModel();

            this._eventAggregator.Subscribe(this);

            this.MainWindowTitle         = strings.GetGUIstr("MainWindowTitle");
            this.MenuButtonTests         = strings.GetGUIstr("MenuButtonTests");
            this.MenuButtonTests_Learn   = strings.GetGUIstr("MenuButtonTests_Learn");
            this.MenuButtonTests_Quiz    = strings.GetGUIstr("MenuButtonTests_Quiz");
            this.MenuButtonEdit          = strings.GetGUIstr("MenuButtonEdit");
            this.MenuButtonEdit_Question = strings.GetGUIstr("MenuButtonEdit_Question");
            this.MenuButtonEdit_Test     = strings.GetGUIstr("MenuButtonEdit_Test");
            this.MenuButtonOther         = strings.GetGUIstr("MenuButtonOther");
            this.MenuButtonAbout         = strings.GetGUIstr("MenuButtonAbout");

            ActivateItem(new AboutViewModel());
        }
示例#6
0
        public EditTestViewModel(IWindowManager windowManager, EventAggregator eventAggregator, ConnectionToDBModel db)
        {
            this._windowManager   = windowManager;
            this._eventAggregator = eventAggregator;

            this.Db = db;
            Task.Run(() =>
            {
                this.Tests = this.Db.GetTests();
                this.Refresh();
            });

            GUIstringsModel strings = new GUIstringsModel();

            this.AvailableTestsLabel = strings.GetGUIstr("AvailableTestsLabel");
            this.EditTestButton      = strings.GetGUIstr("EditTestButton");
            this.DeleteTestButton    = strings.GetGUIstr("DeleteTestButton");
            this.CreateTestButton    = strings.GetGUIstr("CreateTestButton");

            this.EditTestButtonIsEnabled   = "False";
            this.DeleteTestButtonIsEnabled = "False";
        }
        public EditQuestionViewModel(IWindowManager windowManager, EventAggregator eventAggregator, ConnectionToDBModel db)
        {
            this._windowManager   = windowManager;
            this._eventAggregator = eventAggregator;
            this.Db = db;

            this.editQuestionDuringDeleting = null;

            GUIstringsModel strings = new GUIstringsModel();

            this.AvailableQuestionsLabel = strings.GetGUIstr("AvailableQuestionsLabel");
            this.EditQuestionButton      = strings.GetGUIstr("EditQuestionButton");
            this.CreateQuestionButton    = strings.GetGUIstr("CreateQuestionButton");
            this.DeleteQuestionButton    = strings.GetGUIstr("DeleteQuestionButton");
            this.QuestionCantBeDeleted   = strings.GetGUIstr("QuestionCantBeDeleted");
            this.OnlyQuestion            = strings.GetGUIstr("OnlyQuestion");

            Task.Run(() =>
            {
                this.Questions = this.Db.GetQuestions();
                this.Refresh();
            });
            this.EditQuestionButtonIsEnabled   = "False";
            this.DeleteQuestionButtonIsEnabled = "False";
        }