summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.WP8/PageToRendererConverter.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Platform.WP8/PageToRendererConverter.cs')
-rw-r--r--Xamarin.Forms.Platform.WP8/PageToRendererConverter.cs24
1 files changed, 24 insertions, 0 deletions
diff --git a/Xamarin.Forms.Platform.WP8/PageToRendererConverter.cs b/Xamarin.Forms.Platform.WP8/PageToRendererConverter.cs
new file mode 100644
index 00000000..2c809c58
--- /dev/null
+++ b/Xamarin.Forms.Platform.WP8/PageToRendererConverter.cs
@@ -0,0 +1,24 @@
+´╗┐using System;
+using System.Globalization;
+
+namespace Xamarin.Forms.Platform.WinPhone
+{
+ public class PageToRendererConverter : System.Windows.Data.IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ var page = value as Page;
+ if (page == null)
+ return null;
+
+ IVisualElementRenderer renderer = Platform.CreateRenderer(page);
+ Platform.SetRenderer(page, renderer);
+ return renderer;
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+} \ No newline at end of file