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

35 行
896 B

  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.Data;
  7. namespace BeDesignerSCADA.Converters
  8. {
  9. [ValueConversion(typeof(float), typeof(float))]
  10. public class MathAbsConverter : IValueConverter
  11. {
  12. static MathAbsConverter()
  13. {
  14. Instance = new MathAbsConverter();
  15. }
  16. public static MathAbsConverter Instance
  17. {
  18. get;
  19. private set;
  20. }
  21. public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  22. {
  23. return Math.Abs((float)value);
  24. }
  25. public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  26. {
  27. throw new NotImplementedException();
  28. }
  29. }
  30. }