How to set TargetNullValue to visibility. Snap Capture

I am binding TextBlock.Visiblitiy to something and I want to set Binding.TargetNullValue to Collapsed , how can I do this in XAML?

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

+8
silverlight binding xaml targetnullvalue
source share
1 answer

This works for me in SL4:

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

Where is foo:

 public Visibility? Foo { get; set; } 
+7
source share

All Articles