예제 #1
0
        private static void OnErrorMessageChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            string            newErrorMessage = (string)e.NewValue;
            StatusLampControl statusLamp      = (StatusLampControl)d;

            statusLamp.ErrorMessageBox.Text = newErrorMessage.ToString();
        }
예제 #2
0
        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;
            }
        }