BoolVisibilityExConverter.cs 905 B

12345678910111213141516171819202122232425262728293031
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Windows;
  6. using System.Windows.Data;
  7. using Muchinfo.MTPClient.Infrastructure.Converters;
  8. namespace Muchinfo.MTPClient.Infrastructure.Converters
  9. {
  10. public class BoolVisibilityExConverter : IValueConverter
  11. {
  12. public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  13. {
  14. if (value == null)
  15. {
  16. return Visibility.Hidden;
  17. }
  18. if (value.Equals(true))
  19. {
  20. return Visibility.Visible;
  21. }
  22. return Visibility.Hidden;
  23. }
  24. public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  25. {
  26. throw new NotImplementedException();
  27. }
  28. }
  29. }