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.

28 lines
753 B

  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 BPA.UIControl.Converters
  9. {
  10. /// <summary>
  11. /// 获取 Canvas 中心点
  12. /// </summary>
  13. public class GetCanvasCentreConverter : IMultiValueConverter
  14. {
  15. /// <inheritdoc/>
  16. public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
  17. {
  18. return ((double)values[0] - (double)values[1]) / 2;
  19. }
  20. /// <inheritdoc/>
  21. public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
  22. {
  23. return null;
  24. }
  25. }
  26. }