I have a dependency property of type collection, when its callback fires based on the count I need to set the visibility of some of the controls on the screen.
But t
Bool to visibility converter class
public class BoolToVisibilityConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return (bool)value ? Visibility.Visible : Visibility.Hidden;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
Xaml Changes mentioned below to show use of visibility converter class. A group box is used here to show the visibility. on change of radio button selection group box will be visible/hidden.
In ViewModel use invokepropertychange than only you will get the visibility changes on your xaml.
private Boolean isCustomerDetailChecked = false;
public Boolean IsCustomerDetailChecked
{
get
{
return isCustomerDetailChecked;
}
set
{
isCustomerDetailChecked = value;
InvokePropertyChanged("IsCustomerDetailChecked");
}
}