boolToVisibility2.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows;
  7. using System.Windows.Data;
  8. namespace CyberX8_Themes.Converters
  9. {
  10. public class BoolToVisibility2 : IValueConverter
  11. {
  12. public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  13. {
  14. return (bool)value ? Visibility.Visible : Visibility.Collapsed;
  15. }
  16. public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  17. {
  18. return null;
  19. }
  20. }
  21. public class BoolToVisibility3 : IValueConverter
  22. {
  23. public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  24. {
  25. return (bool)value ? Visibility.Visible : Visibility.Hidden;
  26. }
  27. public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  28. {
  29. return null;
  30. }
  31. }
  32. }