summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.WinRT/PageToRenderedElementConverter.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Platform.WinRT/PageToRenderedElementConverter.cs')
-rw-r--r--Xamarin.Forms.Platform.WinRT/PageToRenderedElementConverter.cs31
1 files changed, 31 insertions, 0 deletions
diff --git a/Xamarin.Forms.Platform.WinRT/PageToRenderedElementConverter.cs b/Xamarin.Forms.Platform.WinRT/PageToRenderedElementConverter.cs
new file mode 100644
index 00000000..68e23d31
--- /dev/null
+++ b/Xamarin.Forms.Platform.WinRT/PageToRenderedElementConverter.cs
@@ -0,0 +1,31 @@
+´╗┐using System;
+
+#if WINDOWS_UWP
+
+namespace Xamarin.Forms.Platform.UWP
+#else
+
+namespace Xamarin.Forms.Platform.WinRT
+#endif
+{
+ public class PageToRenderedElementConverter : Windows.UI.Xaml.Data.IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, string language)
+ {
+ var page = value as Page;
+ if (page == null)
+ return null;
+
+ IVisualElementRenderer renderer = page.GetOrCreateRenderer();
+ if (renderer == null)
+ return null;
+
+ return renderer.ContainerElement;
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, string language)
+ {
+ throw new NotImplementedException();
+ }
+ }
+} \ No newline at end of file