BoolToPath.cs 863 B

123456789101112131415161718192021222324
  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.Data;
  7. namespace Venus_Themes.Converters
  8. {
  9. public class BoolToPath : IValueConverter
  10. {
  11. public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  12. {
  13. if (value == null) return "Pack://application:,,,/Venus_Themes;Component/Resources/pump2.png";
  14. return (bool)value ? "Pack://application:,,,/Venus_Themes;Component/Resources/pump2.png" : "Pack://application:,,,/Venus_Themes;Component/Resources/pump2_gray.png";
  15. }
  16. public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  17. {
  18. throw new NotImplementedException();
  19. }
  20. }
  21. }