fix gachalog deletion not refresh view

This commit is contained in:
DismissedLight
2024-07-06 17:45:30 +08:00
parent ab20aa1c64
commit 32a22695e3
3 changed files with 5 additions and 7 deletions

View File

@@ -636,8 +636,10 @@ internal class AdvancedCollectionView<T> : IAdvancedCollectionView<T>, INotifyPr
view.RemoveAt(itemIndex);
if (itemIndex <= CurrentPosition)
{
CurrentPosition--;
OnPropertyChanged(nameof(CurrentItem));
if (itemIndex == CurrentPosition--)
{
OnCurrentChanged();
}
}
OnVectorChanged(new VectorChangedEventArgs(CollectionChange.ItemRemoved, itemIndex, item));

View File

@@ -30,7 +30,7 @@
<DataTemplate x:Key="AnnouncementTemplate">
<ItemContainer cw:Effects.Shadow="{ThemeResource CompatCardShadow}">
<Border Background="{ThemeResource SystemControlAcrylicElementMediumHighBrush}" Style="{StaticResource BorderCardStyle}">
<Border Background="{ThemeResource SystemControlAcrylicElementMediumHighBrush}" Style="{StaticResource AcrylicBorderCardStyle}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>

View File

@@ -303,10 +303,6 @@ internal sealed partial class GachaLogViewModel : Abstraction.ViewModel
using (await EnterCriticalSectionAsync().ConfigureAwait(false))
{
await gachaLogService.RemoveArchiveAsync(Archives.CurrentItem).ConfigureAwait(false);
// reselect first archive
await taskContext.SwitchToMainThreadAsync();
Archives.MoveCurrentToFirst();
}
}