summaryrefslogtreecommitdiff
path: root/PagesGallery/PagesGallery/CapitalizationConverter.cs
diff options
context:
space:
mode:
Diffstat (limited to 'PagesGallery/PagesGallery/CapitalizationConverter.cs')
-rw-r--r--PagesGallery/PagesGallery/CapitalizationConverter.cs20
1 files changed, 20 insertions, 0 deletions
diff --git a/PagesGallery/PagesGallery/CapitalizationConverter.cs b/PagesGallery/PagesGallery/CapitalizationConverter.cs
new file mode 100644
index 00000000..ea4e8d0e
--- /dev/null
+++ b/PagesGallery/PagesGallery/CapitalizationConverter.cs
@@ -0,0 +1,20 @@
+using System;
+using System.Globalization;
+using Xamarin.Forms;
+
+namespace PagesGallery
+{
+ public class CapitalizationConverter : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ var str = (value as string ?? value.ToString());
+ return char.ToUpper(str[0]) + str.Substring(1);
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+} \ No newline at end of file