Esempio n. 1
0
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            CPAS.Models.MSGTYPE msg = (CPAS.Models.MSGTYPE)value;
            Brush brush             = null;

            switch (msg)
            {
            case Models.MSGTYPE.INFO:
                brush = new SolidColorBrush(Color.FromRgb(0, 0, 0));
                break;

            case Models.MSGTYPE.WARNING:
                brush = new SolidColorBrush(Color.FromRgb(200, 200, 0));
                break;

            case Models.MSGTYPE.ERROR:
                brush = new SolidColorBrush(Color.FromRgb(255, 0, 0));
                break;

            default:
                break;
            }
            return(brush);
        }
Esempio n. 2
0
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            CPAS.Models.MSGTYPE msg    = (CPAS.Models.MSGTYPE)value;
            BitmapImage         bitmap = null;

            switch (msg)
            {
            case Models.MSGTYPE.INFO:
                bitmap = new BitmapImage(new Uri(@"..\Images\Info24_24.png", UriKind.Relative));
                break;

            case Models.MSGTYPE.WARNING:
                bitmap = new BitmapImage(new Uri(@"..\Images\Warning24_24.png", UriKind.Relative));
                break;

            case Models.MSGTYPE.ERROR:
                bitmap = new BitmapImage(new Uri(@"..\Images\Error24_24.png", UriKind.Relative));
                break;

            default:
                break;
            }
            return(bitmap);
        }