maui-linux/Xamarin.Forms.ControlGaller.../AttachedStateEffectRenderer.cs

26 строки
688 B
C#

using System;
using System.Linq;
using Xamarin.Forms;
using Xamarin.Forms.ControlGallery.WindowsUniversal;
using Xamarin.Forms.Controls.Effects;
using Xamarin.Forms.Platform.UWP;
[assembly: ExportEffect(typeof(AttachedStateEffectRenderer), AttachedStateEffect.EffectName)]
namespace Xamarin.Forms.ControlGallery.WindowsUniversal
{
public class AttachedStateEffectRenderer : PlatformEffect
{
public AttachedStateEffect MyEffect { get; private set; }
protected override void OnAttached()
{
MyEffect = Element.Effects.OfType<AttachedStateEffect>().First();
MyEffect.Attached(Element);
}
protected override void OnDetached()
{
MyEffect.Detached(Element);
}
}
}