Created
February 20, 2020 12:34
-
-
Save grimorde/3054f70cc62d392d5bf25be7d0af530b to your computer and use it in GitHub Desktop.
Direction Icon Converter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DirectionIconConverter : IValueConverter | |
{ | |
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | |
{ | |
var direction = value.ToString().ToLower(); | |
switch (direction) | |
{ | |
case "north": | |
return IconConstants.ArrowUpBoldCircle; | |
case "south": | |
return IconConstants.ArrowDownBoldCircle; | |
case "east": | |
return IconConstants.ArrowRightBoldCircle; | |
case "west": | |
return IconConstants.ArrowLeftBoldCircle; | |
default: | |
return IconConstants.HelpCircle; | |
} | |
} | |
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) | |
{ | |
throw new NotImplementedException(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment