diff options
Diffstat (limited to 'Xamarin.Forms.ControlGallery.Android/CustomRenderers.cs')
-rw-r--r-- | Xamarin.Forms.ControlGallery.Android/CustomRenderers.cs | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/Xamarin.Forms.ControlGallery.Android/CustomRenderers.cs b/Xamarin.Forms.ControlGallery.Android/CustomRenderers.cs index 7f86a85d..a550212c 100644 --- a/Xamarin.Forms.ControlGallery.Android/CustomRenderers.cs +++ b/Xamarin.Forms.ControlGallery.Android/CustomRenderers.cs @@ -16,6 +16,7 @@ using Android.Content; using Android.Runtime; using Android.Util; using AButton = Android.Widget.Button; +using AView = Android.Views.View; using Android.OS; using System.Reflection; @@ -44,7 +45,7 @@ namespace Xamarin.Forms.ControlGallery.Android } _page = newElement as MasterDetailPage; - _page.PropertyChanged += Page_PropertyChanged; + _page.PropertyChanged += Page_PropertyChanged; _page.LayoutChanged += Page_LayoutChanged; } @@ -416,10 +417,23 @@ namespace Xamarin.Forms.ControlGallery.Android return view; } } - public abstract class CustomContentRenderer : ViewRenderer + + [Preserve] + public class CustomContentRenderer : ViewRenderer { + [Preserve] + public CustomContentRenderer() + { + AutoPackage = true; + } + + protected override AView CreateNativeControl() + { + return new AView(Context); + } } + [Preserve] public class CustomNativeButton : AButton { public CustomNativeButton(IntPtr javaReference, JniHandleOwnership transfer) : base(javaReference, transfer) |