diff --git a/functions/public/Invoke-WPFUIApps.ps1 b/functions/public/Invoke-WPFUIApps.ps1 index 6281d530..d1aaa13c 100644 --- a/functions/public/Invoke-WPFUIApps.ps1 +++ b/functions/public/Invoke-WPFUIApps.ps1 @@ -197,32 +197,6 @@ function Invoke-WPFUIApps { $null = $wrapPanelTop.Children.Add($selectedLabel) $sync.$($selectedLabel.Name) = $selectedLabel - $showSelectedAppsButton = New-Object Windows.Controls.Button - $showSelectedAppsButton.Name = "ShowSelectedAppsButton" - $showSelectedAppsButton.Content = "Show Selected" - $showSelectedAppsButton.Add_Click({ - Show-OnlyCheckedApps -appKeys $sync.SelectedApps -ItemsControl $sync.ItemsControl - }) - $sync.Buttons.Add($showSelectedAppsButton) - - $null = $wrapPanelTop.Children.Add($showSelectedAppsButton) - - $compactViewButton = New-Object Windows.Controls.Button - $compactViewButton.Name = "CompactViewButton" - $compactViewButton.Content = "Compact View" - $compactViewButton.Add_Click({ - $sync.CompactView = -not $sync.CompactView - Update-AppTileProperties - if ($sync.SearchBar.Text -eq "") { - Set-CategoryVisibility -Category "*" -ItemsControl $sync.ItemsControl -automaticVisibility - } - if ($sync.CompactView -eq $true) { - $this.Content = "Expanded View" - } else { - $this.Content = "Compact View" - } - }) - $null = $wrapPanelTop.Children.Add($compactViewButton) [Windows.Controls.DockPanel]::SetDock($wrapPanelTop, [Windows.Controls.Dock]::Top) $null = $dockPanel.Children.Add($wrapPanelTop) return $dockPanel diff --git a/scripts/main.ps1 b/scripts/main.ps1 index 754c53ca..3a2a55e6 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -122,6 +122,18 @@ $sync.configs.applications.PSObject.Properties | ForEach-Object { # Now call the function with the final merged config Invoke-WPFUIElements -configVariable $sync.configs.appnavigation -targetGridName "appscategory" -columncount 1 +# Add logic to handle click to the ToggleView Button on the Install Tab +$sync.WPFToggleView.Add_Click({ + $sync.CompactView = -not $sync.CompactView + Update-AppTileProperties + if ($sync.SearchBar.Text -eq "") { + Set-CategoryVisibility -Category "*" -ItemsControl $sync.ItemsControl -automaticVisibility + } +}) +# Add logic to handle click to the Filter Button on the Install Tab +$sync.WPFSelectedFilter.Add_Click{( + Show-OnlyCheckedApps -appKeys $sync.SelectedApps -ItemsControl $sync.ItemsControl +)} Invoke-WPFUIApps -Apps $sync.configs.applicationsHashtable -targetGridName "appspanel" Invoke-WPFUIElements -configVariable $sync.configs.tweaks -targetGridName "tweakspanel" -columncount 2