コード例 #1
0
        public MainWindowViewModel(IProjectDocumentFactory projectFactory, IDialogService dialogService, IDataAccessService dataService)
        {
            _projectFactory = projectFactory;
            _dialogService  = dialogService;
            _dataService    = dataService;

            ProjectViewModel = new ProjectViewModel();

            ViewModelMediator.Current.GetEvent <ProjectOpenedEventArgs>().Subscribe(this.ProjectOpened);
            ViewModelMediator.Current.GetEvent <TestLocationSelectedEventArgs>().Subscribe(this.TestLocationSelected);

            AppData = StoredAppData.Load();

            var attr = this.GetType().Assembly.GetCustomAttributes(typeof(AssemblyProductAttribute)).Single() as AssemblyProductAttribute;

            ApplicationName = attr.Product;
            WindowTitle     = attr.Product;

            OpenProjectCommand           = new RelayCommand(OpenProjectDialog, null);
            OpenRecentCommand            = new RelayCommand(OpenRecentProject, null);
            SaveProjectCommand           = new RelayCommand(x => SaveProject(), o => _openProject != null);
            CloseProjectCommand          = new RelayCommand(CloseProject, o => _openProject != null);
            TestCommand                  = new RelayCommand(TestProject, o => _openProject != null);
            TestStageCommand             = new RelayCommand(TestStage, o => _openProject != null);
            TestLocationCommand          = new RelayCommand(TestLocation, o => _openProject != null);
            UndoCommand                  = new RelayCommand(Undo, p => ProjectViewModel.CurrentStage != null);
            RedoCommand                  = new RelayCommand(Redo, p => ProjectViewModel.CurrentStage != null);
            EnginePathCommand            = new RelayCommand(ChangeEnginePath);
            NewEntityCommand             = new RelayCommand(NewEntity);
            UpdateLayerVisibilityCommand = new RelayCommand(UpdateLayerVisibility);

            ShowBackstage = true;
        }
コード例 #2
0
        public MainWindowViewModel(IProjectDocumentFactory projectFactory)
        {
            _projectFactory = projectFactory;

            ProjectViewModel = new ProjectViewModel();

            ViewModelMediator.Current.GetEvent <ProjectOpenedEventArgs>().Subscribe(this.ProjectOpened);

            AppData = StoredAppData.Load();

            var attr = this.GetType().Assembly.GetCustomAttributes(typeof(AssemblyProductAttribute)).Single() as AssemblyProductAttribute;

            ApplicationName = attr.Product;
            WindowTitle     = attr.Product;

            TestCommand         = new RelayCommand(TestProject, o => _openProject != null);
            TestStageCommand    = new RelayCommand(TestStage, o => _openProject != null);
            TestLocationCommand = new RelayCommand(TestLocation, o => _openProject != null);
            UndoCommand         = new RelayCommand(Undo, p => ProjectViewModel.CurrentStage != null);
            RedoCommand         = new RelayCommand(Redo, p => ProjectViewModel.CurrentStage != null);
        }