IntToPathDataConverter.cs 1012 B

12345678910111213141516171819202122232425262728293031323334
  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;
  7. using System.Windows.Data;
  8. using System.Windows.Media;
  9. namespace Venus_MainPages.Converters
  10. {
  11. public class IntToPathDataConverter : IValueConverter
  12. {
  13. public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  14. {
  15. if (value == null) return Application.Current.Resources["Icon_Resume"] as Geometry;
  16. var item = (int)value;
  17. if (item == 4)
  18. {
  19. return Application.Current.Resources["Icon_Resume"] as Geometry;
  20. }
  21. else
  22. {
  23. return Application.Current.Resources["Icon_Pause"] as Geometry;
  24. }
  25. }
  26. public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  27. {
  28. return null;
  29. }
  30. }
  31. }