Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class BoolToVisibilityConverter : IValueConverter
- {
- public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
- {
- if ((bool)value)
- return Visibility.Visible;
- else
- return Visibility.Hidden;
- }
- public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
- {
- if ((Visibility)value == Visibility.Hidden)
- return true;
- else
- {
- return false;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment