终端一体化运控平台
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 

38 行
1.0 KiB

  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. }