diff options
Diffstat (limited to 'Xamarin.Forms.Core/PlatformEffect.cs')
-rw-r--r-- | Xamarin.Forms.Core/PlatformEffect.cs | 28 |
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 |