111,092
社区成员




<Window x:Class="Client.AdvanceSearch"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:converters="clr-namespace:你的类命名空间"
<Window.Resources>
<converters:Type2Bool x:Key="Type2Bool"/>
</Window.Resources>
....
<DataGridTextColumn Header="VALUE" Width="*" Binding="{Binding Value}" IsReadOnly="{Binding Type,Converter={StaticResource Type2Bool}}"/>
....
<DataGridTemplateColumn Header="VALUE" Width="*" >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox IsReadOnly="{Binding Type,Converter={StaticResource type2Bool}}" Text="{Binding Value}" BorderThickness="0" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
class Type2Bool : IValueConverter
{
#region IValueConverter Members
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
return (string)value == "Image";
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
throw new NotImplementedException();
}
#endregion
}