diff --git a/src/ValueConverters/StringFormatConverter.cs b/src/ValueConverters/StringFormatConverter.cs index ebfc325..3062da2 100644 --- a/src/ValueConverters/StringFormatConverter.cs +++ b/src/ValueConverters/StringFormatConverter.cs @@ -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); } } @@ -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 }); } /// diff --git a/src/ValueConverters/ToLowerConverter.cs b/src/ValueConverters/ToLowerConverter.cs index c8eb29a..c9253c7 100644 --- a/src/ValueConverters/ToLowerConverter.cs +++ b/src/ValueConverters/ToLowerConverter.cs @@ -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; diff --git a/src/ValueConverters/ToUpperConverter.cs b/src/ValueConverters/ToUpperConverter.cs index affa16c..b2ee1a5 100644 --- a/src/ValueConverters/ToUpperConverter.cs +++ b/src/ValueConverters/ToUpperConverter.cs @@ -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;