summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.ControlGallery.iOS
diff options
context:
space:
mode:
authorSamantha Houts <samantha@teamredwall.com>2017-03-03 12:41:04 (GMT)
committerRui Marinho <me@ruimarinho.net>2017-03-03 12:41:04 (GMT)
commitbc13d3cfeeea62214f0c6f434e5f21f7117e2e1a (patch)
tree5d2e471468e8f754e8e445d2588b0b5fc4508a3c /Xamarin.Forms.ControlGallery.iOS
parent8871077f115e7ef4d15efaa418fd718089db42c7 (diff)
downloadxamarin-forms-bc13d3cfeeea62214f0c6f434e5f21f7117e2e1a.zip
xamarin-forms-bc13d3cfeeea62214f0c6f434e5f21f7117e2e1a.tar.gz
xamarin-forms-bc13d3cfeeea62214f0c6f434e5f21f7117e2e1a.tar.bz2
[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
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 4ea9b30..d310773 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()