init
This commit is contained in:
32
Common/DTS.Common/Converters/StatusToColorConverter.cs
Normal file
32
Common/DTS.Common/Converters/StatusToColorConverter.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user