2016-03-22 23:02:25 +03:00
|
|
|
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; }
|
|
|
|
|
2017-03-07 22:56:24 +03:00
|
|
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
|
|
|
public void SetContainer(TContainer container) => Container = container;
|
|
|
|
|
2016-03-22 23:02:25 +03:00
|
|
|
public TControl Control { get; internal set; }
|
|
|
|
|
2017-03-07 22:56:24 +03:00
|
|
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
|
|
|
public void SetControl(TControl control) => Control = control;
|
|
|
|
|
2016-03-22 23:02:25 +03:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|