summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.WP8/Converters/HorizontalTextAlignmentConverter.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Platform.WP8/Converters/HorizontalTextAlignmentConverter.cs')
-rw-r--r--Xamarin.Forms.Platform.WP8/Converters/HorizontalTextAlignmentConverter.cs20
1 files changed, 20 insertions, 0 deletions
diff --git a/Xamarin.Forms.Platform.WP8/Converters/HorizontalTextAlignmentConverter.cs b/Xamarin.Forms.Platform.WP8/Converters/HorizontalTextAlignmentConverter.cs
new file mode 100644
index 00000000..7923b1d3
--- /dev/null
+++ b/Xamarin.Forms.Platform.WP8/Converters/HorizontalTextAlignmentConverter.cs
@@ -0,0 +1,20 @@
+using System;
+using System.Globalization;
+
+namespace Xamarin.Forms.Platform.WinPhone
+{
+ public class HorizontalTextAlignmentConverter : System.Windows.Data.IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ var textAlign = (TextAlignment)value;
+
+ return textAlign.ToNativeTextAlignment();
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ throw new NotSupportedException();
+ }
+ }
+} \ No newline at end of file