I have an object in my view model that has a bunch of properties, some of them will occasionally be null. I don't want to just show some controls if these particular controls are null. How would I go about hiding the control if the bind is null? I was thinking of some sort of converter, but don't know how I'd go about doing it exactly. Any ideas?
edit: sorry, I should mention that this will also be in Silverlight, so I'm not sure if Style triggers would work...?
This approach is easier:
<CheckBox Visibility="{Binding Path=checkedField, TargetNullValue=Collapsed }">
When the bound property checkedField
is null, the Visibility will be set to Collapsed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With