/// <summary> /// Constructor. /// </summary> /// <param name="mainVM"></param> /// <param name="contextName"></param> /// <param name="contextTitle"></param> public BaseModelContextViewModel(MainWelcomeViewModel mainVM, string contextName, string contextTitle) { this.mainVM = mainVM; this.Name = contextName; this.Titel = contextTitle; this.selectModelContextCommand = new DelegateCommand(SelectModelContextCommand_Executed); }
/// <summary> /// Constructor. /// </summary> /// <param name="mainVM"></param> /// <param name="contextName"></param> /// <param name="contextTitle"></param> public BaseModelContextViewModel(MainWelcomeViewModel mainVM, string contextName, string contextTitle) { this.mainVM = mainVM; this.Name = contextName; this.Titel = contextTitle; this.selectModelContextCommand = new DelegateCommand(SelectModelContextCommand_Executed); }
/// <summary> /// Constuctor. /// </summary> /// <param name="modelContextName">Name of the model context.</param> /// <param name="options">View model options.</param> /// <param name="mainViewModel">The main view model, this MRU view model belongs to.</param> public MRUFilesViewModel(string modelContextName, ViewModelOptions options, MainWelcomeViewModel mainViewModel) { this.Options = options; this.mruFileEntries = new ObservableCollection<MRUFileEntryViewModel>(); this.addCommand = new DelegateCommand<MRUFileEntry>(AddCommandExecuted); this.removeCommand = new DelegateCommand<MRUFileEntry>(RemoveCommandExecuted); this.moveToTopCommand = new DelegateCommand<MRUFileEntry>(MoveToTopCommandExecuted); this.openCommand = new DelegateCommand<MRUFileEntry>(OpenCommandExecuted); this.mainViewModel = mainViewModel; InitializeMRUEntries(modelContextName); }
/// <summary> /// Constuctor. /// </summary> /// <param name="modelContextName">Name of the model context.</param> /// <param name="options">View model options.</param> /// <param name="mainViewModel">The main view model, this MRU view model belongs to.</param> public MRUFilesViewModel(string modelContextName, ViewModelOptions options, MainWelcomeViewModel mainViewModel) { this.Options = options; this.mruFileEntries = new ObservableCollection <MRUFileEntryViewModel>(); this.addCommand = new DelegateCommand <MRUFileEntry>(AddCommandExecuted); this.removeCommand = new DelegateCommand <MRUFileEntry>(RemoveCommandExecuted); this.moveToTopCommand = new DelegateCommand <MRUFileEntry>(MoveToTopCommandExecuted); this.openCommand = new DelegateCommand <MRUFileEntry>(OpenCommandExecuted); this.mainViewModel = mainViewModel; InitializeMRUEntries(modelContextName); }
void WelcomeViewModel_OpenModelRequested(object sender, MainWelcomeViewModel.OpenModelEventArgs e) { // wait till background loading has finished... lock (loaderLock) { if (!hasFinishedLoading) { LoadModelDataHelper(); SetViewModel(); hasFinishedLoading = true; } } SwitchModelContextIfRequired(); // open model --> will automatically trigger update on ui MainViewModel.OpenModel(e.FileName); }