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

@ -1,6 +1,5 @@
using Billing.Themes;
using Billing.UI;
using System.Globalization;
using Xamarin.Essentials;
using Xamarin.Forms;
@ -8,8 +7,8 @@ namespace Billing.Views
{
public partial class SettingPage : BillingPage
{
private static readonly BindableProperty VersionProperty = BindableProperty.Create(nameof(Version), typeof(string), typeof(SettingPage));
private static readonly BindableProperty PrimaryColorProperty = BindableProperty.Create(nameof(PrimaryColor), typeof(string), typeof(SettingPage));
private static readonly BindableProperty VersionProperty = Helper.Create<string, SettingPage>(nameof(Version));
private static readonly BindableProperty PrimaryColorProperty = Helper.Create<string, SettingPage>(nameof(PrimaryColor));
public string Version => (string)GetValue(VersionProperty);
public string PrimaryColor
@ -19,10 +18,12 @@ namespace Billing.Views
}
public Command CategoryCommand { get; }
public Command ColorPickerCommand { get; }
public SettingPage()
{
CategoryCommand = new Command(OnCategoryCommand);
ColorPickerCommand = new Command(OnColorPickerCommand);
InitializeComponent();
var (main, build) = Definition.GetVersion();
@ -60,9 +61,12 @@ namespace Billing.Views
}
}
private void ColorPicker_ColorChanged(object sender, Color e)
private void OnColorPickerCommand(object o)
{
PrimaryColor = Helper.WrapColorString(e.ToHex());
if (o is Color color)
{
PrimaryColor = Helper.WrapColorString(color.ToHex());
}
}
}
}