Billing/Billing.Shared/UI/BillingPage.cs
2022-03-11 22:25:31 +08:00

44 lines
940 B
C#

using System;
using Billing.Themes;
using Xamarin.Forms;
namespace Billing.UI
{
public abstract class BillingPage : ContentPage
{
public event EventHandler Loaded;
public event EventHandler Refreshed;
private bool loaded;
public BillingPage()
{
SetDynamicResource(BackgroundColorProperty, BaseTheme.WindowBackgroundColor);
Shell.SetTabBarIsVisible(this, false);
}
protected virtual void OnLoaded()
{
Loaded?.Invoke(this, EventArgs.Empty);
}
protected virtual void OnRefresh()
{
Refreshed?.Invoke(this, EventArgs.Empty);
}
public void TriggerLoad()
{
if (!loaded)
{
loaded = true;
OnLoaded();
}
}
public void TriggerRefresh()
{
OnRefresh();
}
}
}