WindowStateToPathConverter.cs 956 B

123456789101112131415161718192021222324252627282930313233
  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. using System.Windows.Media;
  9. using System.Windows;
  10. namespace compdfkit_tools.Common
  11. {
  12. public class WindowStateToPathConverter : IValueConverter
  13. {
  14. public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
  15. {
  16. var ws = (WindowState)value;
  17. if (ws == WindowState.Normal)
  18. {
  19. return Geometry.Parse("M 13.5,10.5 H 22.5 V 19.5 H 13.5 Z");
  20. }
  21. else
  22. {
  23. return Geometry.Parse("M 13.5,12.5 H 20.5 V 19.5 H 13.5 Z M 15.5,12.5 V 10.5 H 22.5 V 17.5 H 20.5");
  24. }
  25. }
  26. public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
  27. {
  28. return null;
  29. }
  30. }
  31. }