终端一体化运控平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

OpacityConverter .cs 1.0 KiB

2 years ago
12345678910111213141516171819202122232425262728293031323334353637
  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.Data;
  8. namespace BPASmartClient.CustomResource.Converters
  9. {
  10. public class OpacityConverter: IValueConverter
  11. {
  12. public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
  13. {
  14. double returnValue = 0.2;
  15. if (value != null && value is bool statusValue)
  16. {
  17. switch (statusValue)
  18. {
  19. case true:
  20. returnValue = 1;
  21. break;
  22. case false:
  23. returnValue = 0.2;
  24. break;
  25. }
  26. }
  27. return returnValue;
  28. }
  29. public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
  30. {
  31. throw new NotImplementedException();
  32. }
  33. }
  34. }