HomePageHeightConverter.cs 722 B

12345678910111213141516171819202122232425262728
  1. using System;
  2. using System.Globalization;
  3. using System.Linq;
  4. using System.Windows;
  5. using System.Windows.Data;
  6. namespace Compdfkit_Tools.Common
  7. {
  8. public class HomePageHeightConverter : IMultiValueConverter
  9. {
  10. public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
  11. {
  12. if (values[0] == null || values[1] == null)
  13. {
  14. return false;
  15. }
  16. else
  17. {
  18. return (double)values[0] - (double)values[1];
  19. }
  20. }
  21. public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
  22. {
  23. return null;
  24. }
  25. }
  26. }