20241106_MiLu_upperpc/DeerProject/Common/ConnectConvert.cs

34 lines
941 B
C#
Raw Permalink Normal View History

2025-02-20 05:54:12 +00:00
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 DeerProject.Common
{
public class ConnectConvert : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
Brush TxtForeground = null;
if (value.ToString() == "True")
{
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();
}
}
}