20220510_191_upperpc/AutomaticApp/Common/ConnectConvert.cs
2023-07-27 10:57:34 +08:00

34 lines
947 B
C#

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 AutomaticApp.Common
{
public class ConnectConvert : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
Brush TxtForeground = null;
if (value.ToString() == "已连接")
{
TxtForeground = new SolidColorBrush(Color.FromRgb(0, 255, 0));
}
else
{
TxtForeground = new SolidColorBrush(Color.FromRgb(255, 0, 0));
}
return TxtForeground;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}