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,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();