﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Media;
using static SmartDevice.GlobalModels.MessageModel;

namespace OperatorApp.Converters
{
    class MessageTypeToBrushConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, string language)
        {
            MessageTypes thisMessageType = (MessageTypes)value;

            switch (thisMessageType)
            {
                case MessageTypes.Alarm:
                    return Application.Current.Resources["AlarmBrush"] as SolidColorBrush;
                    break;

                case MessageTypes.Warning:
                    return Application.Current.Resources["WarningBrush"] as SolidColorBrush;
                    break;


                case MessageTypes.Info:
                    return Application.Current.Resources["InfoBrush"] as SolidColorBrush;
                    break;

                default:
                    return Application.Current.Resources["InfoBrush"] as SolidColorBrush;
                    break;

            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, string language)
        {
            throw new NotImplementedException();
        }
    }
}
