Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/ValueConverters/StringFormatConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ public object Convert(object[] values, Type targetType, object parameter, Cultur
// try to load SmartFormat Assembly
var asSmartFormat = Assembly.Load("SmartFormat");
var tt = asSmartFormat.GetType("SmartFormat.Smart");
miFormat = tt.GetMethod("Format", BindingFlags.Static | BindingFlags.Public, null, new Type[] { typeof(string), typeof(object[]) }, null);
miFormat = tt.GetMethod("Format", BindingFlags.Static | BindingFlags.Public, null, new Type[] { typeof(IFormatProvider), typeof(string), typeof(object[]) }, null);
}
catch
{
// fallback just take String.Format
miFormat = typeof(string).GetMethod("Format", BindingFlags.Static | BindingFlags.Public, null, new Type[] { typeof(string), typeof(object[]) }, null);
miFormat = typeof(string).GetMethod("Format", BindingFlags.Static | BindingFlags.Public, null, new Type[] { typeof(IFormatProvider), typeof(string), typeof(object[]) }, null);
}
}

Expand All @@ -61,7 +61,7 @@ public object Convert(object[] values, Type targetType, object parameter, Cultur
return format;

var args = values.Skip(1).ToArray();
return (string)miFormat.Invoke(null, new object[] { format, args });
return (string)miFormat.Invoke(null, new object[] { culture, format, args });
}

/// <inheritdoc/>
Expand Down
2 changes: 1 addition & 1 deletion src/ValueConverters/ToLowerConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public object Convert(object value, Type targetType, object parameter, CultureIn
{
if (value != null)
{
return value.ToString().ToLower();
return value.ToString().ToLower(culture);
}

return null;
Expand Down
2 changes: 1 addition & 1 deletion src/ValueConverters/ToUpperConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public object Convert(object value, Type targetType, object parameter, CultureIn
{
if (value != null)
{
return value.ToString().ToUpper();
return value.ToString().ToUpper(culture);
}

return null;
Expand Down