summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Core/Internals/EffectUtilities.cs
diff options
context:
space:
mode:
authoradrianknight89 <adrianknight89@outlook.com>2017-01-09 04:53:15 -0600
committerRui Marinho <me@ruimarinho.net>2017-01-09 10:53:15 +0000
commita0417309b8dce62dacce1a5519d6de47533b8802 (patch)
treec4d98ed22f030f73c9c4320f61d51a752e5893b5 /Xamarin.Forms.Core/Internals/EffectUtilities.cs
parentc8d54e69ce047b97fdc21afcdad68644ccb1be7a (diff)
downloadxamarin-forms-a0417309b8dce62dacce1a5519d6de47533b8802.tar.gz
xamarin-forms-a0417309b8dce62dacce1a5519d6de47533b8802.tar.bz2
xamarin-forms-a0417309b8dce62dacce1a5519d6de47533b8802.zip
[iOS] Register effects for ScrollView and WebView (#641)
* fix effects * move effect utilities to core * use core class * move to internals namespace * remove IEffectControlProvider from IVisualElementRenderer
Diffstat (limited to 'Xamarin.Forms.Core/Internals/EffectUtilities.cs')
-rw-r--r--Xamarin.Forms.Core/Internals/EffectUtilities.cs16
1 files changed, 16 insertions, 0 deletions
diff --git a/Xamarin.Forms.Core/Internals/EffectUtilities.cs b/Xamarin.Forms.Core/Internals/EffectUtilities.cs
new file mode 100644
index 00000000..f4fe8323
--- /dev/null
+++ b/Xamarin.Forms.Core/Internals/EffectUtilities.cs
@@ -0,0 +1,16 @@
+namespace Xamarin.Forms.Internals
+{
+ internal static class EffectUtilities
+ {
+ public static void RegisterEffectControlProvider(IEffectControlProvider self, IElementController oldElement, IElementController newElement)
+ {
+ IElementController controller = oldElement;
+ if (controller != null && controller.EffectControlProvider == self)
+ controller.EffectControlProvider = null;
+
+ controller = newElement;
+ if (controller != null)
+ controller.EffectControlProvider = self;
+ }
+ }
+} \ No newline at end of file