From 54dad486a439e151641871a66647b3fca43add07 Mon Sep 17 00:00:00 2001 From: rbalsleyMSFT <53497092+rbalsleyMSFT@users.noreply.github.com> Date: Mon, 23 Jun 2025 13:44:56 -0700 Subject: [PATCH] Corrects list view updates to use ItemsSource Modifies the item lookup logic to query the `ItemsSource` property instead of the `Items` collection. This ensures changes are applied directly to the underlying data source, leading to more reliable UI updates. --- FFUDevelopment/FFUUI.Core/FFUUI.Core.Shared.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FFUDevelopment/FFUUI.Core/FFUUI.Core.Shared.psm1 b/FFUDevelopment/FFUUI.Core/FFUUI.Core.Shared.psm1 index b130e48..38f46ad 100644 --- a/FFUDevelopment/FFUUI.Core/FFUUI.Core.Shared.psm1 +++ b/FFUDevelopment/FFUUI.Core/FFUUI.Core.Shared.psm1 @@ -113,7 +113,7 @@ function Update-ListViewItemStatus { if ($WindowObject -is [System.Windows.Window] -and $ListView -is [System.Windows.Controls.ListView]) { # Directly update UI elements as this function is now called on the UI thread try { - $itemToUpdate = $ListView.Items | Where-Object { $_.$IdentifierProperty -eq $IdentifierValue } | Select-Object -First 1 + $itemToUpdate = $ListView.ItemsSource | Where-Object { $_.$IdentifierProperty -eq $IdentifierValue } | Select-Object -First 1 if ($null -ne $itemToUpdate) { $itemToUpdate.$StatusProperty = $StatusValue $ListView.Items.Refresh() # Refresh the view to show the change