BoolToString.cs 941 B

1234567891011121314151617181920212223242526272829303132
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using Windows.UI.Xaml.Data;
  7. namespace Breda_Tour.RouteSelectScreen
  8. {
  9. class BoolToString : IValueConverter
  10. {
  11. private object GetString(object value)
  12. {
  13. if (!(value is bool))
  14. return "ms-appx:///Assets/UitklapIcon1.png";
  15. bool objValue = (bool)value;
  16. if (objValue)
  17. {
  18. return "ms-appx:///Assets/UitklapIcon2.png";
  19. }
  20. return "ms-appx:///Assets/UitklapIcon1.png";
  21. }
  22. public object Convert(object value, Type targetType, object parameter, string language)
  23. {
  24. return GetString(value);
  25. }
  26. public object ConvertBack(object value, Type targetType, object parameter, string language)
  27. {
  28. throw new NotImplementedException();
  29. }
  30. }
  31. }