示例#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;
            }
        }