Skip to content

Instantly share code, notes, and snippets.

@Sa1Gur
Created August 16, 2019 21:41
Show Gist options
  • Save Sa1Gur/54aa29dc2f629aafe6be02948c3360dc to your computer and use it in GitHub Desktop.
Save Sa1Gur/54aa29dc2f629aafe6be02948c3360dc to your computer and use it in GitHub Desktop.
public class SVGPathConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) => GetSVGName((int)(value ?? 0), int.Parse(parameter as string ?? "0"));
string GetSVGName(int status, int parameter)
{
if (status >= parameter)
return "resource://In2TeamsSplitter.Resources.starFilled.svg";
else
return "resource://In2TeamsSplitter.Resources.starEmpty.svg";
}
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