IntToIsEnableConverter.cs 778 B

12345678910111213141516171819202122232425262728293031
  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 IntToIsEnableConverter : IValueConverter
  10. {
  11. public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  12. {
  13. if (value == null) return false;
  14. if ((int)value == 0)
  15. {
  16. return false;
  17. }
  18. else
  19. {
  20. return true;
  21. }
  22. }
  23. public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  24. {
  25. return null;
  26. }
  27. }
  28. }