init
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
using DTS.Common.Interface.Hardware;
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Data;
|
||||
// ReSharper disable PossibleNullReferenceException
|
||||
|
||||
namespace DTS.Common.Converters
|
||||
{
|
||||
public class DiagStatusOffsetColorConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
||||
{
|
||||
if (value is DiagStatuses status)
|
||||
{
|
||||
if (status == DiagStatuses.NoResults) { return BrushesAndColors.Brush_ApplicationStatus_Idle; }
|
||||
if ((status & DiagStatuses.FailedOffset) == DiagStatuses.FailedOffset)
|
||||
{
|
||||
return BrushesAndColors.Brush_ApplicationStatus_Failed;
|
||||
}
|
||||
return BrushesAndColors.Brush_ApplicationStatus_Complete;
|
||||
}
|
||||
return BrushesAndColors.Brush_ApplicationStatus_Idle;
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
||||
{
|
||||
return value.Equals(true) ? parameter : Binding.DoNothing;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user