终端一体化运控平台
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

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