public MainViewModel(InspectionProcess inspectionProcess, SnapshotManager snapshotManager, SettingsViewModel settingsViewModel, ApplicationController controller) { InspectionProcess = inspectionProcess; SnapshotManager = snapshotManager; Settings = settingsViewModel; ApplicationController = controller; InspectionProcess.ProcessChanged += InspectionProcessOnProcessChanged; // STYLE? Who exutes the commands? Dialogs are propagated to the ApplicationController, other code // is directly executed in the view model. TakeSnapshotCommand = Command.CreateWithRegistration(obj => ExecuteTakeSnapshot(), obj => { return(IsUmdhActive == false && InspectionProcess.IsRunning); }); CompareSnapshotsCommand = Command.CreateWithRegistration(obj => ExecuteCompareSnapshots(), obj => { return(IsUmdhActive == false && FirstSnapshot != null && SecondSnapshot != null); }); ConfigureGFlagsCommand = new Command(obj => ExecuteConfigureGFlags()); SettingsCommand = new Command(obj => ExecuteSettings()); SelectProcessCommand = new Command(obj => ExecuteSelectProcess()); LoadDiffFileCommand = new Command(obj => ExecuteLoadDiffFile()); StartProcessCommand = new Command(obj => ApplicationController.ShowRunProcessDialog()); }
public RunProcessViewModel(IProcess process, ApplicationController controller, InspectionProcess inspectionProcess) { _controller = controller; _inspectionProcess = inspectionProcess; _process = process; RunProcessCommand = new Command(ExecuteRunProcess, obj => IsValid); SelectExecutableCommand = new Command(param => SelectExecutable()); }
private void ExecuteSelectProcess() { var process = ApplicationController.ShowProcessDialog(); if (process != null) { InspectionProcess.SetProcess(process); } }