From bc13d3cfeeea62214f0c6f434e5f21f7117e2e1a Mon Sep 17 00:00:00 2001 From: Samantha Houts Date: Fri, 3 Mar 2017 04:41:04 -0800 Subject: [Android] Don't crash if Control is accessed in Effect OnDetached when Page is Disposed. (#773) * Add repro for 51505 * [Android] Don't dispose of EffectControlProvider * Oops --- Xamarin.Forms.ControlGallery.iOS/AppDelegate.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'Xamarin.Forms.ControlGallery.iOS') diff --git a/Xamarin.Forms.ControlGallery.iOS/AppDelegate.cs b/Xamarin.Forms.ControlGallery.iOS/AppDelegate.cs index 4ea9b30f..d3107735 100644 --- a/Xamarin.Forms.ControlGallery.iOS/AppDelegate.cs +++ b/Xamarin.Forms.ControlGallery.iOS/AppDelegate.cs @@ -17,8 +17,22 @@ using Xamarin.Forms.Platform.iOS; [assembly: Dependency(typeof(CacheService))] [assembly: ExportRenderer(typeof(DisposePage), typeof(DisposePageRenderer))] [assembly: ExportRenderer(typeof(DisposeLabel), typeof(DisposeLabelRenderer))] +[assembly: ExportEffect(typeof(BorderEffect), "BorderEffect")] namespace Xamarin.Forms.ControlGallery.iOS { + public class BorderEffect : PlatformEffect + { + protected override void OnAttached() + { + Control.BackgroundColor = UIColor.Blue; + } + + protected override void OnDetached() + { + Control.BackgroundColor = UIColor.Brown; + } + } + public class CacheService : ICacheService { public void ClearImageCache() -- cgit v1.2.3