Пример #1
0
 public ScriptViewModel(ObservableCollection<Script> scripts)
 {
     Scripts = scripts;
     AddExpressionCommand = new DelegateCommand(ExecuteAddExpression);
     AddFileCommand = new DelegateCommand(ExecuteAddFile);
     RemoveScriptCommand = new AutomaticCommand<Script>(ExecuteRemoveScript, CanExecuteRemoveScript);
     EditScriptCommand = new AutomaticCommand<Script>(ExecuteEditScript, CanExecuteEditScript);
 }
Пример #2
0
        public FilesetListViewModel(
            Dispatcher dispatcher,
            IFilesetService filesetService, 
            IFileReplicationService replicationService)
        {
            _dispatcher = dispatcher;
            _filesetService = filesetService;
            _replicationService = replicationService;
            _filesets = new ObservableCollection<FilesetViewModel>();

            AddFilesetCommand = new DelegateCommand(ExecuteAddFileset);
            RemoveFilesetCommand = new AutomaticCommand<FilesetViewModel>(ExecuteRemoveFileset, CanExecuteRemoveFileset);
            SaveAllFilesetsCommand = new DelegateCommand(ExecuteSaveAllFilesets);
            ExportFilesetCommand = new AutomaticCommand<FilesetViewModel>(ExecuteExportFileset, CanExecuteExportFileset);
            ImportFilesetCommand = new DelegateCommand(ExecuteImportFileset);
            CommandBar = new CommandBar();
        }
Пример #3
0
        public FilesetViewViewModel(
            IFilesetService filesetService,
            IFileReplicationService fileReplicationService,
            IActivityLogService activityLogService)
        {
            _filesetService = filesetService;
            _fileReplicationService = fileReplicationService;
            _activityLogService = activityLogService;
            _categories = new ObservableCollection<string>();

            Categories = CollectionViewSource.GetDefaultView(_categories);

            BrowseDestinationFolderCommand = new AutomaticCommand(ExecuteBrowseDestinationFolder, CanExecuteBrowseDestinationFolder);
            BrowseSourceFolderCommand = new AutomaticCommand(ExecuteBrowseSourceFolder, CanExecuteBrowseSourceFolder);

            AddIncludeFileCommand = new AutomaticCommand(ExecuteAddIncludeFile, CanExecuteAddIncludeFile);
            RemoveIncludeFileCommand = new AutomaticCommand<IEnumerable>(ExecuteRemoveIncludeFile, CanExecuteRemoveIncludeFile);

            AddExcludeFileCommand = new AutomaticCommand(ExecuteAddExcludeFile, CanExecuteAddExcludeFile);
            RemoveExcludeFileCommand = new AutomaticCommand<IEnumerable>(ExecuteRemoveExcludeFile, CanExecuteRemoveExcludeFile);

            ManualCopyCommand = new DelegateCommand(ExecuteManualCopy);
            ClearActivityLogCommand = new DelegateCommand(ExecuteClearActiviyLog);
        }