maui-linux/Xamarin.Forms.Core/PlatformEffect.cs

34 строки
873 B
C#
Исходник Обычный вид История

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