Skip to content

Commit 8149db7

Browse files
author
Ariel De Los Santos
committed
feat(281249): improve Login and Create Account page reader support
1 parent 228e1c5 commit 8149db7

6 files changed

Lines changed: 43 additions & 15 deletions

File tree

src/app/ApplicationTemplate.Shared.Views/ApplicationTemplate.Shared.Views.projitems

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<PropertyGroup>
44
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
@@ -91,6 +91,7 @@
9191
<Compile Include="$(MSBuildThisFileDirectory)Controls\Validation\DataValidationView.cs" />
9292
<Compile Include="$(MSBuildThisFileDirectory)Converters\DebugConverter.cs" />
9393
<Compile Include="$(MSBuildThisFileDirectory)Converters\FiltersConverter.cs" />
94+
<Compile Include="$(MSBuildThisFileDirectory)Converters\FromDataValidationStateToVoiceOverStringConverter.cs" />
9495
<Compile Include="$(MSBuildThisFileDirectory)Converters\FromNullableAppBarButtonToAppBarButtonConverter.cs" />
9596
<Compile Include="$(MSBuildThisFileDirectory)Converters\FromNullableBoolToCustomValueConverter.cs" />
9697
<Compile Include="$(MSBuildThisFileDirectory)Framework\AttachableUserControl.cs" />

src/app/ApplicationTemplate.Shared.Views/Content/Authentication/CreateAccountPage.xaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Page x:Class="ApplicationTemplate.Views.Content.CreateAccountPage"
1+
<Page x:Class="ApplicationTemplate.Views.Content.CreateAccountPage"
22
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
44
xmlns:local="using:ApplicationTemplate"
@@ -262,18 +262,18 @@
262262
<local:DataValidationView PropertyName="FavoriteDadNames"
263263
Model="{Binding Form}"
264264
Margin="0,4,0,0">
265-
<!-- List -->
266265
<Grid Background="{StaticResource SurfaceBrush}"
267266
CornerRadius="4">
268-
<!--Remove this line from listView Properties to avoid crash on Windows App: ue:ListViewBaseMultipleSelectionBehavior.SelectedItems="{Binding Form.FavoriteDadNames, Mode=TwoWay}"
269-
TODO : https://dev.azure.com/nventive/Practice%20committees/_workitems/edit/251910-->
270-
<ListView ItemsSource="{Binding DadNames}"
271-
ItemContainerStyle="{StaticResource CheckedListViewItemStyle}"
272-
SelectionMode="Single"
273-
IsItemClickEnabled="True" />
267+
<ItemsControl ItemsSource="{Binding DadNames}">
268+
<ItemsControl.ItemTemplate>
269+
<DataTemplate>
270+
<CheckBox Content="{Binding .}" />
271+
</DataTemplate>
272+
</ItemsControl.ItemTemplate>
273+
</ItemsControl>
274274
</Grid>
275275
</local:DataValidationView>
276-
276+
277277
<!-- Terms of Service Agreement -->
278278
<local:DataValidationView PropertyName="AgreeToTermsOfServices"
279279
Model="{Binding Form}"
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using Nventive.View.Converters;
6+
7+
namespace ApplicationTemplate.Views
8+
{
9+
public class FromDataValidationStateToVoiceOverStringConverter : ConverterBase
10+
{
11+
protected override object Convert(object value, Type targetType, object parameter)
12+
{
13+
var validationFailures = value as DataValidationState;
14+
15+
if (validationFailures != null && validationFailures.Errors.Any())
16+
{
17+
var readableString = string.Join(" \n", validationFailures.Errors);
18+
19+
return readableString;
20+
}
21+
return null;
22+
}
23+
}
24+
}

src/app/ApplicationTemplate.Shared.Views/Styles/Application/Converters.xaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,6 @@
3333
<converters:DebugConverter x:Key="Debug" />
3434

3535
<converters:FromNullableAppBarButtonToAppBarButtonConverter x:Key="NullableAppBarButtonToAppBarButton" />
36+
37+
<converters:FromDataValidationStateToVoiceOverStringConverter x:Key="DataValidationStateToVoiceOverString" />
3638
</ResourceDictionary>

src/app/ApplicationTemplate.Shared.Views/Styles/Controls/CheckBox.xaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
1+
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
22
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
33
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
44
xmlns:win="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
@@ -475,7 +475,6 @@
475475
Width="12"
476476
Height="4"
477477
Opacity="0"
478-
AutomationProperties.AccessibilityView="Raw"
479478
xamarin:Margin="0,2,0,0" />
480479

481480
<Path x:Name="CheckGlyph"
@@ -499,7 +498,8 @@
499498
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
500499
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
501500
Grid.Column="1"
502-
TextWrapping="Wrap" />
501+
TextWrapping="Wrap"
502+
AutomationProperties.AccessibilityView="Raw" />
503503
</Grid>
504504
</ControlTemplate>
505505
</Setter.Value>

src/app/ApplicationTemplate.Shared.Views/Styles/Controls/DataValidationView.xaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
1+
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
22
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
33
xmlns:local="using:ApplicationTemplate">
44

@@ -19,7 +19,8 @@
1919
<Setter Property="Template">
2020
<Setter.Value>
2121
<ControlTemplate TargetType="local:DataValidationView">
22-
<Grid x:Name="RootGrid">
22+
<Grid x:Name="RootGrid"
23+
AutomationProperties.Name="{Binding State, RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource DataValidationStateToVoiceOverString}}" >
2324
<VisualStateManager.VisualStateGroups>
2425
<VisualStateGroup x:Name="ValidationStates">
2526
<VisualState x:Name="Default" />

0 commit comments

Comments
 (0)