public MenuViewModel(StatusBarViewModel sbar)
        {
            _sbar = sbar;
            HiddenMenu = false;
            var hide = new HideMenu(Hide);

            MenuCollection.Add(new Menu("Тестирование", false));
            MenuCollection.Add(new Menu("Запустить тестирование", true)
            {
                Command = new AppCommand(() => { ChangeContent.DynamicInvoke(new RunTestViewModel(_sbar, hide)); })
            });
            MenuCollection.Add(new Menu("Управление", false));
            MenuCollection.Add(new Menu("Добавить вопросы", true)
            {
                Command = new AppCommand(() => { ChangeContent.DynamicInvoke(new AddMuchQuestionViewModel(_sbar, hide)); })
            });
            MenuCollection.Add(new Menu("Изменить вопросы", true)
            {
                Command = new AppCommand(() => { ChangeContent.DynamicInvoke(new EditQuestionsViewModel(_sbar, hide)); })
            });
            MenuCollection.Add(new Menu("Статистика", false));
            MenuCollection.Add(new Menu("Статистика по группам", true)
            {
                Command = new AppCommand(() => { ChangeContent.DynamicInvoke(new StatisticViewModel(_sbar)); })
            });
            MenuCollection.Add(new Menu("Общая статистика", true)
            {
                Command = new AppCommand(() => { ChangeContent.DynamicInvoke(new GeneralStatisticViewModel(_sbar)); })
            });
            MenuCollection.Add(new Menu("Сервис", false));
            MenuCollection.Add(new Menu("Настройки", true)
            {
                Command = new AppCommand(() => { ChangeContent.DynamicInvoke(new SettingViewModel()); })
            });
        }
 public MainWindowViewModel()
 {
     StatusBar = new StatusBarViewModel();
     Menu = new MenuViewModel(StatusBar);
     Menu.ChangeContent += content =>
     {
         (Content as ViewModelBase)?.Dispose();
         Content = content;
     };
     Menu.OnStartup();
 }
 public FunctionalViewModelBase(StatusBarViewModel statusbar, MenuViewModel.HideMenu hide = null)
 {
     _statusbar = statusbar;
     _hideMenu = hide;
     try
     {
         DatabaseManager.LoadData("Дисциплины", out _subjectList);
         DatabaseManager.LoadData("Темы", out _topicList);
         DatabaseManager.LoadData("Подтемы", out _subTopicList);
     }
     catch (Exception ex)
     { MessageBox.Show(ex.Message, App.Current.MainWindow.Title, MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.OK); }
     _model = new QuestionTableModel();
 }
 public StatisticViewModel(StatusBarViewModel sbar)
     : base(sbar)
 {
     DatabaseManager.LoadData("Группы", out _groupList);
 }
 public EditQuestionsViewModel(StatusBarViewModel statusbar, MenuViewModel.HideMenu hide)
     : base(statusbar, hide)
 {
 }
 public GeneralStatisticViewModel(StatusBarViewModel sbar)
     : base(sbar)
 {
 }
 protected void OffVisibility(StatusBarViewModel.StatusBarType type)
 {
     _statusbar.DeleteComponent(type);
 }
 public AddMuchQuestionViewModel(StatusBarViewModel statusbar, MenuViewModel.HideMenu hide)
     : base(statusbar, hide)
 {
 }