WindowStateToPathConverter.cs 857 B

1234567891011121314151617181920212223242526272829
  1. using System;
  2. using System.Globalization;
  3. using System.Windows.Data;
  4. using System.Windows.Media;
  5. using System.Windows;
  6. namespace ComPDFKit.Controls.Common
  7. {
  8. public class WindowStateToPathConverter : IValueConverter
  9. {
  10. public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
  11. {
  12. var ws = (WindowState)value;
  13. if (ws == WindowState.Normal)
  14. {
  15. return Geometry.Parse("M 13.5,10.5 H 22.5 V 19.5 H 13.5 Z");
  16. }
  17. else
  18. {
  19. 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");
  20. }
  21. }
  22. public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
  23. {
  24. return null;
  25. }
  26. }
  27. }