summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Core/PlatformEffect.cs
diff options
context:
space:
mode:
authorJason Smith <jason.smith@xamarin.com>2016-03-22 13:02:25 -0700
committerJason Smith <jason.smith@xamarin.com>2016-03-22 16:13:41 -0700
commit17fdde66d94155fc62a034fa6658995bef6fd6e5 (patch)
treeb5e5073a2a7b15cdbe826faa5c763e270a505729 /Xamarin.Forms.Core/PlatformEffect.cs
downloadxamarin-forms-17fdde66d94155fc62a034fa6658995bef6fd6e5.tar.gz
xamarin-forms-17fdde66d94155fc62a034fa6658995bef6fd6e5.tar.bz2
xamarin-forms-17fdde66d94155fc62a034fa6658995bef6fd6e5.zip
Initial import
Diffstat (limited to 'Xamarin.Forms.Core/PlatformEffect.cs')
-rw-r--r--Xamarin.Forms.Core/PlatformEffect.cs28
1 files changed, 28 insertions, 0 deletions
diff --git a/Xamarin.Forms.Core/PlatformEffect.cs b/Xamarin.Forms.Core/PlatformEffect.cs
new file mode 100644
index 00000000..e92231ce
--- /dev/null
+++ b/Xamarin.Forms.Core/PlatformEffect.cs
@@ -0,0 +1,28 @@
+using System.ComponentModel;
+
+namespace Xamarin.Forms
+{
+ public abstract class PlatformEffect<TContainer, TControl> : Effect where TContainer : class where TControl : class
+ {
+ public TContainer Container { get; internal set; }
+
+ public TControl Control { get; internal set; }
+
+ protected virtual void OnElementPropertyChanged(PropertyChangedEventArgs args)
+ {
+ }
+
+ internal override void SendDetached()
+ {
+ base.SendDetached();
+ Container = null;
+ Control = null;
+ }
+
+ internal override void SendOnElementPropertyChanged(PropertyChangedEventArgs args)
+ {
+ if (IsAttached)
+ OnElementPropertyChanged(args);
+ }
+ }
+} \ No newline at end of file