BoolVisibilityConverter.cs 629 B

1234567891011121314151617181920212223242526
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Globalization;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using System.Windows;
  8. using System.Windows.Data;
  9. namespace EfemDualUI.Converter
  10. {
  11. public class BoolVisibilityConverter : IValueConverter
  12. {
  13. public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
  14. {
  15. var v = (bool)value;
  16. return v == true ? Visibility.Visible : Visibility.Hidden;
  17. }
  18. public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
  19. {
  20. throw new NotImplementedException();
  21. }
  22. }
  23. }