private static void OnErrorMessageChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { string newErrorMessage = (string)e.NewValue; StatusLampControl statusLamp = (StatusLampControl)d; statusLamp.ErrorMessageBox.Text = newErrorMessage.ToString(); }
private static void OnErrorStatusChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { bool newErrorState = (bool)e.NewValue; StatusLampControl statusLamp = (StatusLampControl)d; switch (newErrorState) { case true: statusLamp.ErrorBlock.Fill = new SolidColorBrush(Colors.Red); break; case false: statusLamp.ErrorBlock.Fill = new SolidColorBrush(Colors.Lime); break; default: statusLamp.ErrorBlock.Fill = new SolidColorBrush(Colors.Transparent); break; } }