Example #1
0
        protected virtual TViewModel CreateInstance(TModel model)
        {
            var vm = viewModelFactory.CreateViewModel <TViewModel, TModel> (model);

            modelToViewModel [model] = vm;
            return(vm);
        }
Example #2
0
        public ShellViewModel(IViewModelFactoryService viewModelFactoryService)
        {
            _ViewModelFactoryService = viewModelFactoryService;

            ServerSelectCommand = new Command(ServerSelect);

            _ConnectionViewModel = _ViewModelFactoryService.CreateViewModel <ConnectionViewModel>();
            CurrentViewModel     = _ConnectionViewModel;
        }
Example #3
0
        public MainWindowViewModel(IViewModelFactoryService viewModelFactoryService)
        {
            _viewModelFactoryService = viewModelFactoryService;

            CurrentControls = new List <UserControl>();
            CurrentControls.Add(new TechnologicalProcessView()
            {
                DataContext = (TechnologicalProcessViewModel)_viewModelFactoryService.CreateViewModel(ViewType.TechnologicalProcess)
            });
            CurrentControls.Add(new DatabaseView()
            {
                DataContext = (DatabaseViewModel)_viewModelFactoryService.CreateViewModel(ViewType.Database)
            });

            ShowTreeViewCommand     = new DelegateCommand((o) => ShowTreeView());
            ShowDatabaseViewCommand = new DelegateCommand((o) => ShowDatabaseView());
            CloseApplicationCommand = new DelegateCommand((o) => Environment.Exit(0));
        }