添加项目文件。
This commit is contained in:
27
MSDevTool/Converters/TypeConverter.cs
Normal file
27
MSDevTool/Converters/TypeConverter.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows.Data;
|
||||
|
||||
|
||||
|
||||
namespace MSDevTool.Converters
|
||||
{
|
||||
//用于类型填色
|
||||
public class TypeConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (value is PropValueBase { PropValue: not null } prop)
|
||||
{
|
||||
return prop.PropValue.GetType();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user