diff options
Diffstat (limited to 'Xamarin.Forms.Platform.WinRT/CaseConverter.cs')
-rw-r--r-- | Xamarin.Forms.Platform.WinRT/CaseConverter.cs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/Xamarin.Forms.Platform.WinRT/CaseConverter.cs b/Xamarin.Forms.Platform.WinRT/CaseConverter.cs new file mode 100644 index 00000000..7f8a9009 --- /dev/null +++ b/Xamarin.Forms.Platform.WinRT/CaseConverter.cs @@ -0,0 +1,29 @@ +using System; + +#if WINDOWS_UWP + +namespace Xamarin.Forms.Platform.UWP +#else + +namespace Xamarin.Forms.Platform.WinRT +#endif +{ + public class CaseConverter : Windows.UI.Xaml.Data.IValueConverter + { + public bool ConvertToUpper { get; set; } + + public object Convert(object value, Type targetType, object parameter, string language) + { + if (value == null) + return null; + + var v = (string)value; + return ConvertToUpper ? v.ToUpper() : v.ToLower(); + } + + public object ConvertBack(object value, Type targetType, object parameter, string language) + { + throw new NotSupportedException(); + } + } +}
\ No newline at end of file |