From 3b7d798fdda51a669683ed7d5c3770ebf3adfa77 Mon Sep 17 00:00:00 2001 From: Stephane Delcroix Date: Thu, 8 Sep 2016 20:45:43 +0200 Subject: [Xaml] support native views and native bindings (#266) Allows including Native views directly in xaml. Support for ios, android, UWP --- Xamarin.Forms.Controls/CoreGallery.cs | 1 + .../GalleryPages/XamlNativeViews.xaml | 14 ++++++++++++++ .../GalleryPages/XamlNativeViews.xaml.cs | 21 +++++++++++++++++++++ .../Xamarin.Forms.Controls.csproj | 8 +++++++- 4 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 Xamarin.Forms.Controls/GalleryPages/XamlNativeViews.xaml create mode 100644 Xamarin.Forms.Controls/GalleryPages/XamlNativeViews.xaml.cs (limited to 'Xamarin.Forms.Controls') diff --git a/Xamarin.Forms.Controls/CoreGallery.cs b/Xamarin.Forms.Controls/CoreGallery.cs index 06f214b4..a7743400 100644 --- a/Xamarin.Forms.Controls/CoreGallery.cs +++ b/Xamarin.Forms.Controls/CoreGallery.cs @@ -222,6 +222,7 @@ namespace Xamarin.Forms.Controls var pages = new List { new PlatformSpecificsGallery() {Title = "Platform Specifics"}, new NativeBindingGalleryPage {Title = "Native Binding Controls Gallery"}, + new XamlNativeViews {Title = "Xaml Native Views Gallery"}, new AppLinkPageGallery {Title = "App Link Page Gallery"}, new NestedNativeControlGalleryPage {Title = "Nested Native Controls Gallery"}, new CellForceUpdateSizeGalleryPage {Title = "Cell Force Update Size Gallery"}, diff --git a/Xamarin.Forms.Controls/GalleryPages/XamlNativeViews.xaml b/Xamarin.Forms.Controls/GalleryPages/XamlNativeViews.xaml new file mode 100644 index 00000000..7a1fb850 --- /dev/null +++ b/Xamarin.Forms.Controls/GalleryPages/XamlNativeViews.xaml @@ -0,0 +1,14 @@ + + + + + + + + \ No newline at end of file diff --git a/Xamarin.Forms.Controls/GalleryPages/XamlNativeViews.xaml.cs b/Xamarin.Forms.Controls/GalleryPages/XamlNativeViews.xaml.cs new file mode 100644 index 00000000..1e40fdb7 --- /dev/null +++ b/Xamarin.Forms.Controls/GalleryPages/XamlNativeViews.xaml.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; + +using Xamarin.Forms; + +namespace Xamarin.Forms.Controls +{ + public partial class XamlNativeViews : ContentPage + { + public XamlNativeViews() + { + InitializeComponent(); + BindingContext = new VM { NativeText = "Text set to Native view using native binding" }; + } + } + + public class VM + { + public string NativeText { get; set; } + } +} \ No newline at end of file diff --git a/Xamarin.Forms.Controls/Xamarin.Forms.Controls.csproj b/Xamarin.Forms.Controls/Xamarin.Forms.Controls.csproj index 3b02adbe..7ad923e0 100644 --- a/Xamarin.Forms.Controls/Xamarin.Forms.Controls.csproj +++ b/Xamarin.Forms.Controls/Xamarin.Forms.Controls.csproj @@ -236,6 +236,9 @@ + + XamlNativeViews.xaml + @@ -257,6 +260,9 @@ MSBuild:UpdateDesignTimeXaml + + MSBuild:UpdateDesignTimeXaml + @@ -308,4 +314,4 @@ - \ No newline at end of file + -- cgit v1.2.3