Exemplo n.º 1
0
        public ProjectSettingViewModel(DesignCloudViewModel parent,
                                       List <UserGroupModel> allParties, List <CompanyDto> companies, List <AreaDto> areas,
                                       ProjectModel model)
        {
            //关联对象
            _parent     = parent;
            _allParties = allParties;
            _companies  = companies;
            _project    = model;
            _areas      = areas;

            if (_areas.Count > 0)
            {
                SelectedArea = _areas[0];
            }

            //默认参入方
            if (_allParties.Count > 0)
            {
                SelectedParty = _allParties[0];
            }
            if (_companies.Count > 0)
            {
                SelectedCompany = _companies[0];
            }

            //命令
            OnOKCmd = new DelegateCommand <Window>(new Action <Window>(OnOK),
                                                   new Func <Window, bool>(CanSave));
            ChangeProjectCoverCmd = new DelegateCommand <string>(
                new Action <string>(ChangeProjectCover));
            SelectProjectCoverCmd = new DelegateCommand(new Action(SelectProjectCover));
            SelectionChangedCmd   = new DelegateCommand <ExCommandParameter>(
                new Action <ExCommandParameter>(SelectionChanged));
        }
Exemplo n.º 2
0
 public MfVaultViewModel(DesignCloudViewModel parent, ProjectDto project)
 {
     _parent     = parent;
     Id          = project.Id.ToString();
     Project     = project;
     DisplayName = project.Name;
     _goback     = new RelayCommand(obj =>
     {
         if (BrowserView != null)
         {
             BrowserView.GoBack();
         }
     });
     _goforward = new RelayCommand(obj =>
     {
         if (BrowserView != null)
         {
             BrowserView.GoForward();
         }
     });
     _searchCmd = new RelayCommand(_ => SearchOp());
 }
Exemplo n.º 3
0
        public ProjectCategoryViewModel(DesignCloudViewModel parent)
        {
            _parent = parent;

            //命令
            AddProjectCmd           = new DelegateCommand(new Action(AddProjectForAllBackup));
            ProjSelectionChangedCmd = new DelegateCommand <ExCommandParameter>(
                new Action <ExCommandParameter>(ProjSelectionChanged));
            ProjMouseDoubleClickCmd = new DelegateCommand <ExCommandParameter>(
                new Action <ExCommandParameter>(ProjMouseDoubleClick));
            StatusSelectionChangedCmd = new DelegateCommand <ExCommandParameter>(
                new Action <ExCommandParameter>(StatusSelectionChanged));
            SettingSelectionChangedCmd = new DelegateCommand <ExCommandParameter>(
                new Action <ExCommandParameter>(SettingSelectionChanged));
            ShowProjectsHoursCmd = new DelegateCommand(ShowProjectsHours);
            ShowProjectsIntegratedManagementCmd = new DelegateCommand(ShowProjectsIntegratedManagement);

            //加载数据
            _initBkWork                     = new BackgroundWorker();
            _initBkWork.DoWork             += InitBkWorker;
            _initBkWork.RunWorkerCompleted += InitBkWorkerCompleted;
            _initBkWork.RunWorkerAsync();
        }
Exemplo n.º 4
0
 protected MFilesViewModelBase(DesignCloudViewModel parent)
 {
     _parent     = parent;
     _httpClient = _parent.Context.GetVaultClient();
 }