PropertyPanelVisible.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. using System.Windows.Media;
  10. namespace PDF_Office.DataConvert
  11. {
  12. public class CheckToVisibleMutiConvert : IMultiValueConverter
  13. {
  14. public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  15. {
  16. for (int i = 0; i < values.Length; i++)
  17. {
  18. if ((bool)values[i] == true)
  19. return Visibility.Collapsed;
  20. }
  21. return Visibility.Visible;
  22. }
  23. public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
  24. {
  25. throw new NotImplementedException();
  26. }
  27. }
  28. public class ColorToBrushConverter : IValueConverter
  29. {
  30. public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
  31. {
  32. if (value is Color)
  33. {
  34. return new SolidColorBrush((Color)value);
  35. }
  36. return Brushes.Transparent;
  37. }
  38. public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
  39. {
  40. throw new NotImplementedException();
  41. }
  42. }
  43. }