fix: improve screen reader accessibility by naming control containers (#4287)

This commit is contained in:
makhlwf
2026-04-02 22:06:39 +02:00
committed by GitHub
parent e94742a77d
commit 74f990028f
2 changed files with 5 additions and 0 deletions

View File

@@ -31,6 +31,7 @@ function Initialize-InstallCategoryAppList {
$categoryContainer.Orientation = "Vertical"
$categoryContainer.Margin = New-Object Windows.Thickness(0, 0, 0, 0)
$categoryContainer.HorizontalAlignment = [Windows.HorizontalAlignment]::Stretch
[System.Windows.Automation.AutomationProperties]::SetName($categoryContainer, $Category)
# Bind Width to the ItemsControl's ActualWidth to force full-row layout in WrapPanel
$binding = New-Object Windows.Data.Binding

View File

@@ -157,6 +157,7 @@ function Invoke-WPFUIElements {
switch ($entryInfo.Type) {
"Toggle" {
$dockPanel = New-Object Windows.Controls.DockPanel
[System.Windows.Automation.AutomationProperties]::SetName($dockPanel, $entryInfo.Content)
$checkBox = New-Object Windows.Controls.CheckBox
$checkBox.Name = $entryInfo.Name
$checkBox.HorizontalAlignment = "Right"
@@ -241,6 +242,7 @@ function Invoke-WPFUIElements {
$horizontalStackPanel = New-Object Windows.Controls.StackPanel
$horizontalStackPanel.Orientation = "Horizontal"
$horizontalStackPanel.Margin = "0,5,0,0"
[System.Windows.Automation.AutomationProperties]::SetName($horizontalStackPanel, $entryInfo.Content)
$label = New-Object Windows.Controls.Label
$label.Content = $entryInfo.Content
@@ -313,6 +315,7 @@ function Invoke-WPFUIElements {
# Create a StackPanel for this group
$groupStackPanel = New-Object Windows.Controls.StackPanel
$groupStackPanel.Orientation = "Vertical"
[System.Windows.Automation.AutomationProperties]::SetName($groupStackPanel, $entryInfo.GroupName)
# Add the group container to the ItemsControl
$itemsControl.Items.Add($groupStackPanel) | Out-Null
@@ -346,6 +349,7 @@ function Invoke-WPFUIElements {
default {
$horizontalStackPanel = New-Object Windows.Controls.StackPanel
$horizontalStackPanel.Orientation = "Horizontal"
[System.Windows.Automation.AutomationProperties]::SetName($horizontalStackPanel, $entryInfo.Content)
$checkBox = New-Object Windows.Controls.CheckBox
$checkBox.Name = $entryInfo.Name