This commit is contained in:
gaoyuan
2022-03-11 22:25:31 +08:00
parent 6d2e0624ab
commit 51ac42b9fc
14 changed files with 134 additions and 19 deletions

View File

@ -1,3 +1,4 @@
using Billing.Store;
using Billing.Themes;
using Billing.UI;
using Xamarin.Essentials;
@ -17,11 +18,13 @@ namespace Billing.Views
set => SetValue(PrimaryColorProperty, value);
}
public Command ShareCommand { get; }
public Command CategoryCommand { get; }
public Command ColorPickerCommand { get; }
public SettingPage()
{
ShareCommand = new Command(OnShareCommand);
CategoryCommand = new Command(OnCategoryCommand);
ColorPickerCommand = new Command(OnColorPickerCommand);
InitializeComponent();
@ -48,6 +51,21 @@ namespace Billing.Views
Light.Instance.RefreshColor(Color.FromHex(color));
}
private async void OnShareCommand()
{
if (Tap.IsBusy)
{
return;
}
using (Tap.Start())
{
await Share.RequestAsync(new ShareFileRequest
{
File = new ShareFile(StoreHelper.DatabasePath)
});
}
}
private async void OnCategoryCommand()
{
if (Tap.IsBusy)