public MainViewModel() { IDevicesManager manager = new DevicesManager(new CapdxxSearchApi(), new CapdxxApi(), new ModuleFactory()); model = new MainModel(manager); model.PropertyChanged += (s, e) => { NotifyPropertyChanged(e.PropertyName); }; SearchCommand = new RelayCommand(obj => Search(obj)); active = false; }
public ModuleViewModel(IModule module) { this.module = module; module.PropertyChanged += (s, e) => { NotifyPropertyChanged(e.PropertyName); }; module.NewValueReceived += (s, value, channel) => { foreach (IOscillographContext context in oscillographContexts) context.AddNewValue(value, channel); }; StartCommand = new RelayCommand(obj => Start(obj)); StopCommand = new RelayCommand(obj => Stop(obj)); oscillographContexts = new IOscillographContext[0]; }
public MainViewModel() { Modules = new ObservableCollection<ModuleViewModel>(); PressViewModel pressViewModel = new PressViewModel(); PulseViewModel pulseViewModel = new PulseViewModel(); EcgViewModel ecgViewModel = new EcgViewModel(); Modules.Add(pressViewModel); Modules.Add(pulseViewModel); Modules.Add(ecgViewModel); model = new MainModel(pressViewModel, pulseViewModel); model.PropertyChanged += (s, e) => { NotifyPropertyChanged(e.PropertyName); }; ActiveCommand = new RelayCommand((obj) => { model.Active = !model.Active; }); }
public PressModuleViewModel(IPressModule module) : base(module) { this.module = module; GateOnAndPumpOnCommand = new RelayCommand(obj => GateOnAndPumpOn(obj)); PumpOffCommand = new RelayCommand(obj => PumpOff(obj)); GateOffCommand = new RelayCommand(obj => GateOff(obj)); }