Now I am working with WPF. My Controls visibility binded like in here:
<Button Content="Click me!" Visibility="{Binding Path=SomePath, Converter={StaticResource MessageCloseConverter}}"/>
This works after DataContext
is setted. But when I run project first time DataContext
is null
and Visibility is Visible.I want set visibility collapsed first time and after setting DataContext
converter should work like now.
Use the FallbackValue
property:
<Button Content="Click me!" Visibility="{Binding Path=SomePath, Converter={StaticResource MessageCloseConverter}, FallbackValue=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