private void UserLedOnOnUserLedStateChanged(IUserLed userLed, OnOffValue value) { if (value == OnOffValue.On) { IndicatocColor = _onColor; } else { IndicatocColor = _offColor; } }
public UserLedControlViewModel(IUserLed userLed) { userLed.OnUserLedStateChanged += UserLedOnOnUserLedStateChanged; _userLed = userLed; Name = userLed.UniqueIdentifyer.IdentifierString; OnCommand = new RelayCommand(OnCommandMethod); OffCommand = new RelayCommand(OffCommandMethod); BlinkCommand = new RelayCommand(BlinkCommandMethod); _offColor = new SolidColorBrush(Colors.Gray); _onColor = new SolidColorBrush(Colors.Red); userLed.RaiseAllObjectEvents(); }
public UserLedControl(IUserLed userLed) { ViewModel = new UserLedControlViewModel(userLed); InitializeComponent(); }
private void RaiseOnUserLedStateChanged(IUserLed userled, OnOffValue value) => Task.Run(() => OnUserLedStateChanged?.Invoke(userled, value));