filter conditions

This commit is contained in:
2022-03-10 17:27:49 +08:00
parent 84ec2df987
commit 74053a328e
18 changed files with 330 additions and 95 deletions

View File

@ -8,6 +8,8 @@ namespace Billing.UI
{
public event EventHandler Loaded;
private bool loaded;
public BillingPage()
{
SetDynamicResource(BackgroundColorProperty, BaseTheme.WindowBackgroundColor);
@ -18,5 +20,14 @@ namespace Billing.UI
{
Loaded?.Invoke(this, EventArgs.Empty);
}
public void TriggerLoad()
{
if (!loaded)
{
loaded = true;
OnLoaded();
}
}
}
}

View File

@ -8,15 +8,19 @@ namespace Billing.UI
{
public class ColorPicker : SKCanvasView
{
public static readonly BindableProperty ColorProperty = BindableProperty.Create(nameof(Color), typeof(Color), typeof(ColorPicker));
public static readonly BindableProperty ColorProperty = Helper.Create<Color, ColorPicker>(nameof(Color));
public static readonly BindableProperty CommandProperty = Helper.Create<Command, ColorPicker>(nameof(Command));
public Color Color
{
get => (Color)GetValue(ColorProperty);
set => SetValue(ColorProperty, value);
}
public event EventHandler<Color> ColorChanged;
public Command Command
{
get => (Command)GetValue(CommandProperty);
set => SetValue(CommandProperty, value);
}
private SKPoint? lastTouch;
@ -116,7 +120,7 @@ namespace Billing.UI
var color = touchColor.ToFormsColor();
Color = color;
ColorChanged?.Invoke(this, color);
Command?.Execute(color);
}
}
@ -126,8 +130,8 @@ namespace Billing.UI
lastTouch = e.Location;
var size = CanvasSize;
if ((e.Location.X > 0 && e.Location.X < size.Width) &&
(e.Location.Y > 0 && e.Location.Y < size.Height))
if (e.Location.X > 0 && e.Location.X < size.Width &&
e.Location.Y > 0 && e.Location.Y < size.Height)
{
e.Handled = true;
InvalidateSurface();

View File

@ -92,6 +92,12 @@ namespace Billing.UI
var result = await page.DisplayActionSheet(message, Resource.No, yes);
return result == yes;
}
public static DateTime LastMoment(this DateTime date)
{
// add 23:59:59.999...
return date.AddTicks(863999999999);
}
}
public static class ModelExtensionHelper