Add Get-Installed Loading Indicator + small fixes

This commit is contained in:
Marterich
2024-10-13 20:33:26 +02:00
parent 6d88e51462
commit cf664bd1d3
6 changed files with 21 additions and 47 deletions

View File

@ -20,9 +20,13 @@ function Invoke-WPFGetInstalled {
return
}
$preferChoco = $sync.WPFpreferChocolatey.IsChecked
$sync.ItemsControl.Dispatcher.Invoke([action]{
$sync.ItemsControl.Items | ForEach-Object { $_.Visibility = [Windows.Visibility]::Collapsed}
$null = $sync.itemsControl.Items.Add($sync.LoadingLabel)
})
Invoke-WPFRunspace -ArgumentList $checkbox, $preferChoco -ParameterList @(,("ShowOnlyCheckedApps",${function:Show-OnlyCheckedApps})) -DebugPreference $DebugPreference -ScriptBlock {
param($checkbox, $preferChoco, $ShowOnlyCheckedApps,$DebugPreference)
Write-Host $ShowOnlyCheckedApps.ToString()
$sync.ProcessRunning = $true
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Indeterminate" })
@ -46,6 +50,7 @@ function Invoke-WPFGetInstalled {
})
$sync.ItemsControl.Dispatcher.Invoke([action]{
$ShowOnlyCheckedApps.Invoke($sync.SelectedApps, $sync.ItemsControl)
$sync.ItemsControl.Items.Remove($sync.LoadingLabel)
})
Write-Host "Done..."
$sync.ProcessRunning = $false