1.Common增加ColorConverter_IsTestOK
This commit is contained in:
parent
0dbfa3758f
commit
8f41b72d85
|
@ -2,6 +2,7 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.ServiceModel;
|
||||
using Aitex.Core.Common;
|
||||
using Aitex.Core.Common.DeviceData;
|
||||
using Aitex.Sorter.Common;
|
||||
using MECF.Framework.Common.Device.Bases;
|
||||
using MECF.Framework.Common.Equipment;
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace Aitex.Core.UI.Converters
|
||||
{
|
||||
/// <summary>
|
||||
/// 输入数值检测
|
||||
/// </summary>
|
||||
public class ColorConverter_IsTestOK : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (value == null || value.ToString().Length == 0)
|
||||
return new SolidColorBrush(Colors.Gray);
|
||||
if (value.ToString() == "OK")
|
||||
return new SolidColorBrush(Colors.Green);
|
||||
else if (value.ToString() == "NG")
|
||||
return new SolidColorBrush(Colors.MediumVioletRed);
|
||||
else
|
||||
return new SolidColorBrush(Colors.Gray);
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -324,6 +324,7 @@
|
|||
<Compile Include="Converters\BoolSensorConverter.cs" />
|
||||
<Compile Include="Converters\BoolVisibilityConverter.cs" />
|
||||
<Compile Include="Converters\CenterBorderGapMaskConverter.cs" />
|
||||
<Compile Include="Converters\ColorConverter_IsTestOK.cs" />
|
||||
<Compile Include="Converters\ColorToBrushConverter.cs" />
|
||||
<Compile Include="Converters\EngModeToBdColorConverter.cs" />
|
||||
<Compile Include="Converters\EngModeToBdThicknessConverter.cs" />
|
||||
|
|
Loading…
Reference in New Issue