BoolToPath.cs 782 B

1234567891011121314151617181920212223
  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 CyberX8_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. return (bool)value ? "Pack://application:,,,/CyberX8_Themes;Component/Resources/pump.png" : "Pack://application:,,,/CyberX8_Themes;Component/Resources/pump_gray.png";
  14. }
  15. public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  16. {
  17. throw new NotImplementedException();
  18. }
  19. }
  20. }