summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.ControlGallery.iOS
diff options
context:
space:
mode:
authorSamantha Houts <samantha@teamredwall.com>2017-03-03 04:41:04 -0800
committerRui Marinho <me@ruimarinho.net>2017-03-03 12:45:50 +0000
commit78df8b9f54593dac1a3d5c766ee11fd59bbae350 (patch)
treec6dd24b1602fdacb94c30589fb1908a71ba4ec09 /Xamarin.Forms.ControlGallery.iOS
parentdbe0d4945da400a5b00599155d22cda78754294a (diff)
downloadxamarin-forms-78df8b9f54593dac1a3d5c766ee11fd59bbae350.tar.gz
xamarin-forms-78df8b9f54593dac1a3d5c766ee11fd59bbae350.tar.bz2
xamarin-forms-78df8b9f54593dac1a3d5c766ee11fd59bbae350.zip
[Android] Don't crash if Control is accessed in Effect OnDetached when Page is Disposed. (#772)
* Add repro for 51505 * [Android] Don't dispose of EffectControlProvider * Oops
Diffstat (limited to 'Xamarin.Forms.ControlGallery.iOS')
-rw-r--r--Xamarin.Forms.ControlGallery.iOS/AppDelegate.cs14
1 files changed, 14 insertions, 0 deletions
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()