summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Core
diff options
context:
space:
mode:
authoradrianknight89 <adrianknight89@outlook.com>2017-01-09 10:53:15 (GMT)
committerRui Marinho <me@ruimarinho.net>2017-01-09 10:53:15 (GMT)
commita0417309b8dce62dacce1a5519d6de47533b8802 (patch)
treec4d98ed22f030f73c9c4320f61d51a752e5893b5 /Xamarin.Forms.Core
parentc8d54e69ce047b97fdc21afcdad68644ccb1be7a (diff)
downloadxamarin-forms-a0417309b8dce62dacce1a5519d6de47533b8802.zip
xamarin-forms-a0417309b8dce62dacce1a5519d6de47533b8802.tar.gz
xamarin-forms-a0417309b8dce62dacce1a5519d6de47533b8802.tar.bz2
[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')
-rw-r--r--Xamarin.Forms.Core/Internals/EffectUtilities.cs16
-rw-r--r--Xamarin.Forms.Core/Xamarin.Forms.Core.csproj3
2 files changed, 18 insertions, 1 deletions
diff --git a/Xamarin.Forms.Core/Internals/EffectUtilities.cs b/Xamarin.Forms.Core/Internals/EffectUtilities.cs
new file mode 100644
index 0000000..f4fe832
--- /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
diff --git a/Xamarin.Forms.Core/Xamarin.Forms.Core.csproj b/Xamarin.Forms.Core/Xamarin.Forms.Core.csproj
index dd01d4b..9bfb7ba 100644
--- a/Xamarin.Forms.Core/Xamarin.Forms.Core.csproj
+++ b/Xamarin.Forms.Core/Xamarin.Forms.Core.csproj
@@ -86,6 +86,7 @@
<Compile Include="DataTemplateSelector.cs" />
<Compile Include="DateChangedEventArgs.cs" />
<Compile Include="DelegateLogListener.cs" />
+ <Compile Include="Internals\EffectUtilities.cs" />
<Compile Include="EnumerableExtensions.cs" />
<Compile Include="PlatformConfiguration\AndroidSpecific\AppCompat\Application.cs" />
<Compile Include="PlatformConfiguration\AndroidSpecific\Application.cs" />
@@ -461,4 +462,4 @@
</PostBuildEvent>
</PropertyGroup>
<ItemGroup />
-</Project>
+</Project> \ No newline at end of file