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

@@ -73,7 +73,7 @@ namespace Billing.Views
InitializeComponent();
}
public override void OnLoaded()
protected override void OnLoaded()
{
editorName.SetFocus();
}

View File

@@ -116,7 +116,7 @@ namespace Billing.Views
}
}
public override void OnLoaded()
protected override void OnLoaded()
{
editorAmount.SetFocus();
}

View File

@@ -78,7 +78,7 @@ namespace Billing.Views
InitializeComponent();
}
public override void OnLoaded()
protected override void OnLoaded()
{
editorName.SetFocus();
}

View File

@@ -55,7 +55,7 @@ namespace Billing.Views
InitializeComponent();
}
public override void OnLoaded()
protected override void OnLoaded()
{
billingDate.SetDateTime(DateTime.Today);
}

View File

@@ -11,6 +11,10 @@
BindingContext="{x:Reference settingPage}"
Shell.TabBarIsVisible="True">
<ContentPage.ToolbarItems>
<ToolbarItem Order="Primary" IconImageSource="project.png" Command="{Binding ShareCommand}"/>
</ContentPage.ToolbarItems>
<TableView Intent="Settings" HasUnevenRows="True">
<TableSection Title="{r:Text About}">
<ui:OptionTextCell Height="36" Title="{r:Text Version}"

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)