Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accessibility enhancements in app instal #1780

Merged
merged 4 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
<ContentControl IsTabStop="False" Content="{Binding IsInstalled, Converter={StaticResource LearnMoreInstalledConverter}}" />
<Button
IsEnabled="{Binding IsInstalled, Converter={StaticResource BoolNegationConverter}}"
AutomationProperties.Name="{Binding ButtonAutomationName}"
Padding="5"
Command="{Binding ToggleSelectionCommand,Mode=OneWay}">
<FontIcon
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
</GridView.ItemsPanel>
<GridView.ItemTemplate>
<DataTemplate x:DataType="viewmodels:PackageViewModel">
<controls:PackageDetailsSettingsCard Width="320" Padding="5">
<controls:PackageDetailsSettingsCard AutomationProperties.Name="{x:Bind PackageTitle}" Width="320" Padding="5">
<ToolTipService.ToolTip>
<controls:PackageDetailsTooltip Package="{x:Bind}" />
</ToolTipService.ToolTip>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
</AutoSuggestBox>

<!-- Main content -->
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto" Name="MainContent">
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto" Name="MainContent" AutomationProperties.AccessibilityView="Raw">
<ContentControl
IsTabStop="False"
Margin="0 0 10 0"
Expand Down
2 changes: 0 additions & 2 deletions tools/SetupFlow/DevHome.SetupFlow/Views/PackageView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@
Grid.Column="1"
AutomationProperties.Name="{Binding ButtonAutomationName}"
IsEnabled="{Binding IsInstalled, Converter={StaticResource BoolNegationConverter}}"
Background="Transparent"
BorderThickness="0"
Command="{Binding ToggleSelectionCommand}"
HorizontalAlignment="Right"
Padding="5">
Expand Down
2 changes: 2 additions & 0 deletions tools/SetupFlow/DevHome.SetupFlow/Views/ReviewView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,15 @@

<NavigationView x:Name="ReviewNavigationView"
Visibility="{x:Bind ViewModel.ReviewTabs, Converter={StaticResource EmptyCollectionToVisibilityConverter}}"
Loaded="ReviewNavigationView_Loaded"
HorizontalAlignment="Stretch"
Padding="0" Margin="0"
PaneDisplayMode="Top"
SelectionFollowsFocus="Enabled"
IsBackButtonVisible="Collapsed"
IsSettingsVisible="False"
MenuItemsSource="{x:Bind ViewModel.ReviewTabs, Mode=OneWay}"
AutomationProperties.AccessibilityView="Raw"
SelectedItem="{x:Bind ViewModel.SelectedReviewTab, Mode=TwoWay}">
<NavigationView.Resources>
<SolidColorBrush x:Key="NavigationViewContentBackground" Color="Transparent"/>
Expand Down
51 changes: 34 additions & 17 deletions tools/SetupFlow/DevHome.SetupFlow/Views/ReviewView.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,34 @@
// Copyright (c) Microsoft Corporation and Contributors.
// Licensed under the MIT License.

using DevHome.SetupFlow.ViewModels;
using Microsoft.UI.Xaml.Controls;

namespace DevHome.SetupFlow.Views;

public sealed partial class ReviewView : UserControl
{
public ReviewView()
{
this.InitializeComponent();
}

public ReviewViewModel ViewModel => (ReviewViewModel)this.DataContext;
}
// Copyright (c) Microsoft Corporation and Contributors.
// Licensed under the MIT License.

using System.Collections;
using DevHome.SetupFlow.ViewModels;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Automation;
using Microsoft.UI.Xaml.Controls;

namespace DevHome.SetupFlow.Views;

public sealed partial class ReviewView : UserControl
{
public ReviewView()
{
this.InitializeComponent();
}

public ReviewViewModel ViewModel => (ReviewViewModel)this.DataContext;

private void ReviewNavigationView_Loaded(object sender, RoutedEventArgs e)
{
if (sender is NavigationView navView && navView.MenuItemsSource is IEnumerable menuItems)
{
foreach (var item in menuItems)
{
if (navView.ContainerFromMenuItem(item) is NavigationViewItem navViewItem && navViewItem.Content is ReviewTabViewModelBase reviewTab)
{
AutomationProperties.SetName(navViewItem, reviewTab.TabTitle);
}
}
}
}
}
7 changes: 6 additions & 1 deletion tools/SetupFlow/DevHome.SetupFlow/Views/SearchView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,12 @@
</StackPanel>

<!-- Search result -->
<ListView Name="PackagesListView" Grid.Row="1" ItemsSource="{x:Bind ViewModel.ResultPackages, Mode=OneWay}" SelectionMode="None">
<ListView
Name="PackagesListView"
Grid.Row="1"
Loaded="PackagesListView_Loaded"
ItemsSource="{x:Bind ViewModel.ResultPackages, Mode=OneWay}"
SelectionMode="None">
<ListView.ItemContainerStyle>
<Style TargetType="ListViewItem">
<Setter Property="Template" Value="{ThemeResource AppManagementSelectablePackageTemplate}" />
Expand Down
48 changes: 32 additions & 16 deletions tools/SetupFlow/DevHome.SetupFlow/Views/SearchView.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,32 @@
// Copyright (c) Microsoft Corporation and Contributors.
// Licensed under the MIT License.

using DevHome.SetupFlow.ViewModels;
using Microsoft.UI.Xaml.Controls;

namespace DevHome.SetupFlow.Views;
public sealed partial class SearchView : UserControl
{
public SearchViewModel ViewModel => (SearchViewModel)DataContext;

public SearchView()
{
this.InitializeComponent();
}
}
// Copyright (c) Microsoft Corporation and Contributors.
// Licensed under the MIT License.

using DevHome.SetupFlow.ViewModels;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Automation;
using Microsoft.UI.Xaml.Controls;

namespace DevHome.SetupFlow.Views;
public sealed partial class SearchView : UserControl
{
public SearchViewModel ViewModel => (SearchViewModel)DataContext;

public SearchView()
{
this.InitializeComponent();
}

private void PackagesListView_Loaded(object sender, RoutedEventArgs e)
{
if (sender is ListView listView)
{
for (var i = 0; i < listView.Items.Count; i++)
{
if (listView.ContainerFromIndex(i) is ListViewItem item && item.Content is PackageViewModel package)
{
AutomationProperties.SetName(item, package.PackageTitle);
}
}
}
}
}