public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (targetType != typeof(Dictionary <string, string>)) { throw new InvalidOperationException("The target must be a Dictionary<string, string>"); } if (!(value is Color color)) { throw new InvalidOperationException("The value must be a color"); } return(SvgUtils.ReplaceStringMap(color, replaceText: _replacementText)); }
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (targetType != typeof(Dictionary <string, string>)) { throw new InvalidOperationException("The target must be a Dictionary<string, string>"); } if (!(value is bool)) { throw new InvalidOperationException("The value must be a bool"); } return(SvgUtils.ReplaceStringMap((bool)value ? _trueColor : _falseColor, _replaceTitle, _replaceText)); }
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (targetType != typeof(Dictionary <string, string>)) { throw new InvalidOperationException("The target must be a Dictionary<string, string>"); } if (!(value is Tier tier)) { throw new InvalidOperationException("The value must be a Tier"); } return(SvgUtils.ReplaceStringMap(tier.ToTierColor(), replaceText: "\"#00ff00\"")); }