private void AddStartCode(object parameter) { var vm = parameter as OutputText; if (vm != null) { if (LastMeasureSetting == null || !String.IsNullOrEmpty(LastMeasureSetting.StartCode)) { MeasureSettings.Add(new MeasureSettingViewModel((MeasureSettings.Count() + 1).ToString())); RaisePropertyChanged(() => LastMeasureSetting); } LastMeasureSetting.StartCode = vm.Text.Trim(); LastMeasureSetting.StartVisibility = Visibility.Collapsed; LastMeasureSetting.StopVisibility = Visibility.Visible; } }
private void Init() { RestartCommand = new Command(Restart, () => InProgress); StartStopCommand = new Command(StartStop, () => ExecutableExists()); AddStartCodeCommand = new Command <object>(AddStartCode); AddStopCodeCommand = new Command <object>(AddStopCode); // populate one setting in case of empty if (!MeasureSettings.Any()) { MeasureSettings.Add(new MeasureSettingViewModel("1")); } if (LoggingSourceType == LoggingTypeSourceEnum.Console) { RegisterProcessWatcher(); } }