33 lines
1.1 KiB
Plaintext
33 lines
1.1 KiB
Plaintext
using DTS.Common.Enums;
|
|
using System;
|
|
using System.Windows.Data;
|
|
using System.Windows.Media;
|
|
|
|
namespace DTS.Common.Converters
|
|
{
|
|
public class StatusToColorConverter : IValueConverter
|
|
{
|
|
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
|
{
|
|
if (!(value is UIItemStatus itemStatus))
|
|
{
|
|
return Brushes.Transparent;
|
|
}
|
|
switch (itemStatus)
|
|
{
|
|
case UIItemStatus.None: return Brushes.Black;
|
|
case UIItemStatus.Success: return BrushesAndColors.Brush_ApplicationStatus_Complete;
|
|
case UIItemStatus.Failed: return BrushesAndColors.Brush_ApplicationStatus_Failed;
|
|
case UIItemStatus.Error: return Brushes.Red;
|
|
case UIItemStatus.Warning: return Brushes.OrangeRed;
|
|
}
|
|
return Brushes.Black;
|
|
}
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
|
{
|
|
return null;
|
|
}
|
|
}
|
|
}
|