문제

I'm binding TextBlock.Visiblitiy to something, and I want to set the Binding.TargetNullValue to Collapsed, how can I do it in XAML?

This one How do I set TargetNullValue to a date? does not work in Silverlight. (No x:Static).

도움이 되었습니까?

해결책

This is working for me in SL4:

<TextBlock Text="Text" Visibility="{Binding Foo, TargetNullValue=Collapsed}"/>

Where Foo:

public Visibility? Foo { get; set; }
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top