Skip to content

Commit

Permalink
feat(281249): improve Login and Create Account page reader support
Browse files Browse the repository at this point in the history
  • Loading branch information
Arieldelossantos committed May 16, 2023
1 parent 228e1c5 commit 8149db7
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
Expand Down Expand Up @@ -91,6 +91,7 @@
<Compile Include="$(MSBuildThisFileDirectory)Controls\Validation\DataValidationView.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Converters\DebugConverter.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Converters\FiltersConverter.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Converters\FromDataValidationStateToVoiceOverStringConverter.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Converters\FromNullableAppBarButtonToAppBarButtonConverter.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Converters\FromNullableBoolToCustomValueConverter.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Framework\AttachableUserControl.cs" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Page x:Class="ApplicationTemplate.Views.Content.CreateAccountPage"
<Page x:Class="ApplicationTemplate.Views.Content.CreateAccountPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:ApplicationTemplate"
Expand Down Expand Up @@ -262,18 +262,18 @@
<local:DataValidationView PropertyName="FavoriteDadNames"
Model="{Binding Form}"
Margin="0,4,0,0">
<!-- List -->
<Grid Background="{StaticResource SurfaceBrush}"
CornerRadius="4">
<!--Remove this line from listView Properties to avoid crash on Windows App: ue:ListViewBaseMultipleSelectionBehavior.SelectedItems="{Binding Form.FavoriteDadNames, Mode=TwoWay}"
TODO : https://dev.azure.com/nventive/Practice%20committees/_workitems/edit/251910-->
<ListView ItemsSource="{Binding DadNames}"
ItemContainerStyle="{StaticResource CheckedListViewItemStyle}"
SelectionMode="Single"
IsItemClickEnabled="True" />
<ItemsControl ItemsSource="{Binding DadNames}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<CheckBox Content="{Binding .}" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Grid>
</local:DataValidationView>

<!-- Terms of Service Agreement -->
<local:DataValidationView PropertyName="AgreeToTermsOfServices"
Model="{Binding Form}"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Nventive.View.Converters;

namespace ApplicationTemplate.Views
{
public class FromDataValidationStateToVoiceOverStringConverter : ConverterBase
{
protected override object Convert(object value, Type targetType, object parameter)
{
var validationFailures = value as DataValidationState;

if (validationFailures != null && validationFailures.Errors.Any())
{
var readableString = string.Join(" \n", validationFailures.Errors);

return readableString;
}
return null;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,6 @@
<converters:DebugConverter x:Key="Debug" />

<converters:FromNullableAppBarButtonToAppBarButtonConverter x:Key="NullableAppBarButtonToAppBarButton" />

<converters:FromDataValidationStateToVoiceOverStringConverter x:Key="DataValidationStateToVoiceOverString" />
</ResourceDictionary>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:win="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
Expand Down Expand Up @@ -475,7 +475,6 @@
Width="12"
Height="4"
Opacity="0"
AutomationProperties.AccessibilityView="Raw"
xamarin:Margin="0,2,0,0" />

<Path x:Name="CheckGlyph"
Expand All @@ -499,7 +498,8 @@
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Grid.Column="1"
TextWrapping="Wrap" />
TextWrapping="Wrap"
AutomationProperties.AccessibilityView="Raw" />
</Grid>
</ControlTemplate>
</Setter.Value>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:ApplicationTemplate">

Expand All @@ -19,7 +19,8 @@
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="local:DataValidationView">
<Grid x:Name="RootGrid">
<Grid x:Name="RootGrid"
AutomationProperties.Name="{Binding State, RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource DataValidationStateToVoiceOverString}}" >
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="ValidationStates">
<VisualState x:Name="Default" />
Expand Down

0 comments on commit 8149db7

Please sign in to comment.