1
结合
我有以下转换器:能见度转换器在XAML
public class MyConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
return Visibility.Hidden;
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
throw new NotImplementedException();
}
...
我则在XAML使用此如下:
<Resources>
<conv:MyConverter x:Key="MyValToVisibilityConverter" />
</Resources>
...
<CheckBox x:Name="MyCheckBox" Content="Should not be visible"
Visibility="{Binding ElementName=Visibility, Converter={StaticResource MyValToVisibilityConverter}}"
...
这编译和运行,并始终显示为复选框可见。
你的哪个XAML元素被命名为“能见度” ? VS输出窗口中是否有错误提示? – Gene 2012-04-03 10:43:20