Pixiview/Gallery.Android/Renderers/AdaptedPageRenderer.cs
2021-08-04 10:27:41 +08:00

44 lines
1021 B
C#

using Android.Content;
using Gallery.Droid.Renderers;
using Gallery.UI;
using Xamarin.Forms;
using Xamarin.Forms.Platform.Android;
[assembly: ExportRenderer(typeof(AdaptedPage), typeof(AdaptedPageRenderer))]
namespace Gallery.Droid.Renderers
{
public class AdaptedPageRenderer : PageRenderer
{
public AdaptedPageRenderer(Context context) : base(context)
{
}
protected override void OnAttachedToWindow()
{
base.OnAttachedToWindow();
if (Element is AdaptedPage page)
{
page.OnLoad();
}
}
protected override void Dispose(bool disposing)
{
if (Element is AdaptedPage page)
{
page.OnUnload();
}
base.Dispose(disposing);
}
//protected override void OnDetachedFromWindow()
//{
// App.DebugPrint("detached from window");
// base.OnDetachedFromWindow();
//}
}
}