Пример #1
0
 private void UserLedOnOnUserLedStateChanged(IUserLed userLed, OnOffValue value)
 {
     if (value == OnOffValue.On)
     {
         IndicatocColor = _onColor;
     }
     else
     {
         IndicatocColor = _offColor;
     }
 }
Пример #2
0
        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();
        }
Пример #3
0
 public UserLedControl(IUserLed userLed)
 {
     ViewModel = new UserLedControlViewModel(userLed);
     InitializeComponent();
 }
Пример #4
0
 private void RaiseOnUserLedStateChanged(IUserLed userled, OnOffValue value) => Task.Run(() => OnUserLedStateChanged?.Invoke(userled, value));