This commit is contained in:
Tsanie 2022-03-03 15:22:19 +08:00
parent 25191127f3
commit 030993b40e
2 changed files with 6 additions and 1 deletions

View File

@ -116,6 +116,7 @@ namespace Billing.Views
var result = await this.ShowConfirm(Resource.ConfirmDeleteAccount); var result = await this.ShowConfirm(Resource.ConfirmDeleteAccount);
if (result) if (result)
{ {
App.Accounts.Remove(account);
var group = accounts.FirstOrDefault(a => a.Key == account.Category); var group = accounts.FirstOrDefault(a => a.Key == account.Category);
if (group == null) if (group == null)
{ {
@ -123,6 +124,10 @@ namespace Billing.Views
return; return;
} }
group.Remove(account); group.Remove(account);
if (group.Count == 0)
{
accounts.Remove(group);
}
groupLayout.Refresh(accounts); groupLayout.Refresh(accounts);
RefreshBalance(); RefreshBalance();

View File

@ -21,7 +21,7 @@
</ContentPage.Resources> </ContentPage.Resources>
<Shell.TitleView> <Shell.TitleView>
<Grid ColumnSpacing="16" ColumnDefinitions="20,*,20"> <Grid ColumnSpacing="16" ColumnDefinitions="20, *">
<ui:TintImage Source="calendar.png" WidthRequest="20" HeightRequest="20" VerticalOptions="Center"/> <ui:TintImage Source="calendar.png" WidthRequest="20" HeightRequest="20" VerticalOptions="Center"/>
<ui:LongPressButton Grid.Column="1" Text="{Binding SelectedDate, Converter={StaticResource titleDateConverter}}" <ui:LongPressButton Grid.Column="1" Text="{Binding SelectedDate, Converter={StaticResource titleDateConverter}}"
TextColor="{DynamicResource PrimaryColor}" TextColor="{DynamicResource PrimaryColor}"