I am workin on WPF application.
I am using System.Windows.Controls.BooleanToVisibilityConverter to toggle visibility of my CheckBox as follows :
Visibility="{Binding IsCheckVisible, Converter={StaticResource BooleanToVisibilityConverter}}">
where IsCheckVisible is boolean property I am setting in ViewModel DataContext.
I want CheckBox to be collapsed or hidden by default when application started as my bool property will be false by default. But problem is it is still Visible when app is started. Plz Help me out.
Thanks In Advance.
Problem can be that you set your property
IsCheckVisibletofalseafter UI initialization. You must either supportINotifyPropertyChangedinterface in your ViewModel class and callPropertyChangedwhen you are changing ViewModel properties values or you can set IsCheckVisible to returnfalseby default. For example: