From d77ad8abc4aba113e8b5dfb520bd40e83c7bdf42 Mon Sep 17 00:00:00 2001 From: AmirMS <104940545+AmelBawa-msft@users.noreply.github.com> Date: Wed, 14 Aug 2024 13:58:35 -0700 Subject: [PATCH] screen reader --- .../DevHome.SetupFlow/Services/StringResourceKey.cs | 1 + .../DevHome.SetupFlow/Strings/en-us/Resources.resw | 4 ++++ .../DevHome.SetupFlow/ViewModels/AppManagementViewModel.cs | 6 ++++++ 3 files changed, 11 insertions(+) diff --git a/tools/SetupFlow/DevHome.SetupFlow/Services/StringResourceKey.cs b/tools/SetupFlow/DevHome.SetupFlow/Services/StringResourceKey.cs index b89cb03eb7..53b9160fa6 100644 --- a/tools/SetupFlow/DevHome.SetupFlow/Services/StringResourceKey.cs +++ b/tools/SetupFlow/DevHome.SetupFlow/Services/StringResourceKey.cs @@ -77,6 +77,7 @@ public static class StringResourceKey public static readonly string PathWithColon = nameof(PathWithColon); public static readonly string RemoveApplication = nameof(RemoveApplication); public static readonly string RemovedApplication = nameof(RemovedApplication); + public static readonly string RemovedAllApplications = nameof(RemovedAllApplications); public static readonly string ResultCountPlural = nameof(ResultCountPlural); public static readonly string ResultCountSingular = nameof(ResultCountSingular); public static readonly string RestorePackagesTitle = nameof(RestorePackagesTitle); diff --git a/tools/SetupFlow/DevHome.SetupFlow/Strings/en-us/Resources.resw b/tools/SetupFlow/DevHome.SetupFlow/Strings/en-us/Resources.resw index fc7ee75c81..7ae0721622 100644 --- a/tools/SetupFlow/DevHome.SetupFlow/Strings/en-us/Resources.resw +++ b/tools/SetupFlow/DevHome.SetupFlow/Strings/en-us/Resources.resw @@ -593,6 +593,10 @@ Removed {0} {Locked="{0}"}Text announced when a button for removing an application is invoked. {0} is replaced by the application name. + + Removed all applications + Text announced when a button for removing all applications is invoked. + {0} Results found for "{1}" {Locked="{0}", "{1}"} Label for a search result counter. {0} is replaced by the number of result items. {1} is replaced with the search term. diff --git a/tools/SetupFlow/DevHome.SetupFlow/ViewModels/AppManagementViewModel.cs b/tools/SetupFlow/DevHome.SetupFlow/ViewModels/AppManagementViewModel.cs index 7e626ecc1c..6526d31433 100644 --- a/tools/SetupFlow/DevHome.SetupFlow/ViewModels/AppManagementViewModel.cs +++ b/tools/SetupFlow/DevHome.SetupFlow/ViewModels/AppManagementViewModel.cs @@ -9,6 +9,7 @@ using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.Input; using DevHome.Common.Extensions; +using DevHome.Common.Services; using DevHome.SetupFlow.Services; using Microsoft.Extensions.Hosting; using Serilog; @@ -18,6 +19,7 @@ namespace DevHome.SetupFlow.ViewModels; public partial class AppManagementViewModel : SetupPageViewModelBase { private readonly ILogger _log = Log.ForContext("SourceContext", nameof(AppManagementViewModel)); + private readonly IScreenReaderService _screenReaderService; private readonly ShimmerSearchViewModel _shimmerSearchViewModel; private readonly SearchViewModel _searchViewModel; private readonly PackageCatalogListViewModel _packageCatalogListViewModel; @@ -45,11 +47,13 @@ public partial class AppManagementViewModel : SetupPageViewModelBase public AppManagementViewModel( ISetupFlowStringResource stringResource, + IScreenReaderService screenReaderService, SetupFlowOrchestrator orchestrator, IHost host, PackageProvider packageProvider) : base(stringResource, orchestrator) { + _screenReaderService = screenReaderService; _packageProvider = packageProvider; _searchViewModel = host.GetService(); _shimmerSearchViewModel = host.GetService(); @@ -107,6 +111,8 @@ private void RemoveAllPackages() { package.IsSelected = false; } + + _screenReaderService.Announce(StringResource.GetLocalized(StringResourceKey.RemovedAllApplications)); } [RelayCommand]