Exemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the MainViewModel class.
 /// </summary>
 public MainViewModel(IDataService dataService, IMainSettings settings)
 {
     _dataService = dataService;
     _settings = settings;
     _dataService.Init();
     _dataService.InputStateChanged += _dataService_InputStateChanged;
     //Doors = new DoolsViewModel(_dataService);
     DiscretInputs = new DiscretInputsViewModel(_settings.DiscretInputKeys.Keys);
     Relays = new RelaysViewModel(_settings.RelayKeys.Keys, (key, value) => _dataService.SetRelayState(_settings.RelayKeys[key], value));
 }