Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

Commit eac4432

Browse files
authored
Improving the narrator with DevHome (#2986)
* Making the narrator say what I want it to say * Fixing merge * Using a theme resource * Adding a comment about a string
1 parent 762f78d commit eac4432

File tree

5 files changed

+25
-3
lines changed

5 files changed

+25
-3
lines changed

tools/Environments/DevHome.Environments/Strings/en-us/Resources.resw

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,4 +351,8 @@
351351
<value>Go to extensions library</value>
352352
<comment>Text for when the environment page in Dev Home is empty and the user has no extensions installed that support environments</comment>
353353
</data>
354+
<data name="MoreOptionsButtonName" xml:space="preserve">
355+
<value>More Options</value>
356+
<comment>The text narrator should say for the ... button</comment>
357+
</data>
354358
</root>

tools/Environments/DevHome.Environments/ViewModels/ComputeSystemCardBase.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using System.Collections.ObjectModel;
66
using CommunityToolkit.Mvvm.ComponentModel;
77
using DevHome.Common.Environments.Models;
8+
using DevHome.Common.Services;
89
using Microsoft.UI.Xaml.Media.Imaging;
910
using Microsoft.Windows.DevHome.SDK;
1011
using Windows.Foundation;
@@ -41,6 +42,13 @@ public abstract partial class ComputeSystemCardBase : ObservableObject
4142
[ObservableProperty]
4243
private bool _shouldShowLaunchOperation;
4344

45+
/// <summary>
46+
/// This string can, and should, be in a resource file. But can't because this string used in a
47+
/// data template.
48+
/// </summary>
49+
[ObservableProperty]
50+
private string _moreOptionsButtonName;
51+
4452
public BitmapImage? HeaderImage { get; protected set; }
4553

4654
public BitmapImage? BodyImage { get; protected set; }
@@ -54,6 +62,12 @@ public abstract partial class ComputeSystemCardBase : ObservableObject
5462
[ObservableProperty]
5563
private string _uiMessageToDisplay = string.Empty;
5664

65+
public ComputeSystemCardBase()
66+
{
67+
var stringResource = new StringResource("DevHome.Environments.pri", "DevHome.Environments/Resources");
68+
_moreOptionsButtonName = stringResource.GetLocalized("MoreOptionsButtonName");
69+
}
70+
5771
public override string ToString()
5872
{
5973
return $"{Name} {AlternativeName}";

tools/Environments/DevHome.Environments/ViewModels/CreateComputeSystemOperationViewModel.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ public CreateComputeSystemOperationViewModel(
6262
_stringResource = stringResource;
6363
_computeSystemManager = computeSystemManager;
6464
Operation = operation;
65+
Name = Operation.EnvironmentName;
6566

6667
var providerDetails = Operation.ProviderDetails;
6768
ProviderDisplayName = providerDetails.ComputeSystemProvider.DisplayName;

tools/Environments/DevHome.Environments/Views/LandingPage.xaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@
5252
<DataTemplate x:Key="ThreeDotsButton" x:DataType="vm:ComputeSystemViewModel">
5353
<Grid>
5454
<Button
55-
Style="{StaticResource HorizontalThreeDotsStyle}">
55+
Style="{StaticResource HorizontalThreeDotsStyle}"
56+
AutomationProperties.Name="{x:Bind MoreOptionsButtonName}">
5657
<Button.Flyout>
5758
<customControls:CardFlyout ItemsViewModels="{x:Bind DotOperations, Mode=OneWay}"/>
5859
</Button.Flyout>
@@ -64,7 +65,8 @@
6465
<DataTemplate x:Key="ThreeDotsButtonForCreation" x:DataType="vm:CreateComputeSystemOperationViewModel">
6566
<Grid>
6667
<Button
67-
Style="{StaticResource HorizontalThreeDotsStyle}">
68+
Style="{StaticResource HorizontalThreeDotsStyle}"
69+
AutomationProperties.Name="{x:Bind MoreOptionsButtonName}">
6870
<Button.Flyout>
6971
<customControls:CardFlyout ItemsViewModels="{x:Bind DotOperations, Mode=OneWay}" />
7072
</Button.Flyout>

tools/SetupFlow/DevHome.SetupFlow/Views/ReviewView.xaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@
6262
<StackPanel>
6363
<Expander HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch"
6464
IsExpanded="true"
65-
MinHeight="64" CornerRadius="4" Padding="24,0,24,7" >
65+
MinHeight="64" CornerRadius="{ThemeResource ControlCornerRadius}" Padding="24,0,24,7"
66+
AutomationProperties.Name="{x:Bind ViewModel.ReviewPageExpanderDescription, Mode=OneWay}">
6667
<Expander.Header>
6768
<Grid>
6869
<Grid.ColumnDefinitions>

0 commit comments

Comments
 (0)