Some threading stuff.

This commit is contained in:
Burak Kaan Köse
2025-11-01 21:46:23 +01:00
parent ae9e35e091
commit 5f9b51e4db
4 changed files with 49 additions and 9 deletions
@@ -405,12 +405,12 @@ public class WinoMailCollection : ObservableRecipient, IRecipient<SelectedItemsC
private async Task UpdateExistingItemAsync(MailItemViewModel existingItem, MailCopy updatedItem)
{
UpdateUniqueIdHashes(existingItem, false);
await ExecuteUIThread(() =>
{
await ExecuteUIThread(() =>
{
existingItem.MailCopy = updatedItem;
});
UpdateUniqueIdHashes(existingItem, true);
}
@@ -702,10 +702,10 @@ public class WinoMailCollection : ObservableRecipient, IRecipient<SelectedItemsC
if (itemContainer.ItemViewModel != null)
{
UpdateUniqueIdHashes(itemContainer.ItemViewModel, false);
// Update the MailCopy - this will automatically notify all dependent properties
itemContainer.ItemViewModel.MailCopy = updatedMailCopy;
UpdateUniqueIdHashes(itemContainer.ItemViewModel, true);
}
@@ -962,6 +962,7 @@ public class WinoMailCollection : ObservableRecipient, IRecipient<SelectedItemsC
}
finally
{
Messenger.Unregister<SelectedItemsChangedMessage>(this);
Messenger.Register<SelectedItemsChangedMessage>(this);
Messenger.Send(new SelectedItemsChangedMessage());