Add Right-Click Action on App Install Page (#3367)

* Add right click context menu for app entries with install, uninstall, and info options

* Add hand cursor on mouse over for button in inputXML.xaml
This commit is contained in:
Martin Wiethan
2025-05-23 17:52:57 +02:00
committed by GitHub
parent 63d56bcac9
commit 41df9d3d88
3 changed files with 119 additions and 2 deletions

View File

@ -18,7 +18,7 @@ function Initialize-InstallAppEntry {
$border.Style = $sync.Form.Resources.AppEntryBorderStyle
$border.Tag = $appKey
$border.ToolTip = $Apps.$appKey.description
$border.Add_MouseUp({
$border.Add_MouseLeftButtonUp({
$childCheckbox = ($this.Child | Where-Object {$_.Template.TargetType -eq [System.Windows.Controls.Checkbox]})[0]
$childCheckBox.isChecked = -not $childCheckbox.IsChecked
})
@ -32,6 +32,13 @@ function Initialize-InstallAppEntry {
$this.SetResourceReference([Windows.Controls.Control]::BackgroundProperty, "AppInstallUnselectedColor")
}
})
$border.Add_MouseRightButtonUp({
# Store the selected app in a global variable so it can be used in the popup
$sync.appPopupSelectedApp = $this.Tag
# Set the popup position to the current mouse position
$sync.appPopup.PlacementTarget = $this
$sync.appPopup.IsOpen = $true
})
$checkBox = New-Object Windows.Controls.CheckBox
$checkBox.Name = $appKey