BoolOpposedVisibility.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. //----------------------------------------------------------------
  6. //Module Name: $safeprojectname$
  7. //Purpose:
  8. //CopyRight: Muchinfo
  9. //History:
  10. //----------------------------------------------------------------
  11. //DateTime 2016/1/19 11:28:57
  12. //Author
  13. //Description Create
  14. //----------------------------------------------------------------
  15. using System.Windows;
  16. using System.Windows.Data;
  17. using Muchinfo.MTPClient.Infrastructure.Converters;
  18. namespace Muchinfo.MTPClient.Infrastructure.Converters
  19. {
  20. public class BoolOpposedVisibility: IValueConverter
  21. {
  22. public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  23. {
  24. if (value == null)
  25. {
  26. return Visibility.Collapsed;
  27. }
  28. if (value.Equals(false))
  29. {
  30. return Visibility.Visible;
  31. }
  32. return Visibility.Collapsed;
  33. }
  34. public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  35. {
  36. throw new NotImplementedException();
  37. }
  38. }
  39. }