Skip to content
Open
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 @@ -89,7 +89,14 @@
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type primitives:ComboBoxFormInputView}">
<ComboBox x:Name="Selector" IsEnabled="{TemplateBinding IsEnabled}" />
<ComboBox x:Name="Selector" IsEnabled="{TemplateBinding IsEnabled}" >
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automation Name can also be set for the comboBox, like
AutomationProperties.Name="{Binding Element.Label, RelativeSource={RelativeSource AncestorType=primitives:ComboBoxFormInputView}}"

Could be implemented similarly for other platforms

<ComboBox.ItemContainerStyle>
<Style TargetType="ComboBoxItem">
<Setter Property="AutomationProperties.Name" Value="{Binding Name}" />
<Setter Property="AutomationProperties.HelpText" Value="{Binding Description}" />
</Style>
</ComboBox.ItemContainerStyle>
</ComboBox>
</ControlTemplate>
</Setter.Value>
</Setter>
Expand Down Expand Up @@ -166,7 +173,8 @@
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBox x:Name="TextInput" MaxLines="{TemplateBinding MaxLines}" MinLines="{TemplateBinding MinLines}" BorderThickness="0" />
<TextBox x:Name="TextInput" MaxLines="{TemplateBinding MaxLines}" MinLines="{TemplateBinding MinLines}" BorderThickness="0"
AutomationProperties.Name="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Element.Label}" AutomationProperties.HelpText="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Element.Description}" />
<TextBlock Text="!" Background="Transparent" Width="10" Foreground="Red" Visibility="Collapsed" HorizontalAlignment="Right" VerticalAlignment="Center" x:Name="ErrorInfo" Grid.Column="1" />
<Button Content="&#xED14;" FontFamily="Segoe MDL2 Assets" Background="Transparent" Grid.Column="2"
Padding="8" Margin="-8,-8,-5,-7" BorderThickness="0" Visibility="Collapsed" HorizontalAlignment="Right" VerticalAlignment="Center" x:Name="BarcodeButton" />
Expand Down Expand Up @@ -257,7 +265,8 @@
<ControlTemplate TargetType="{x:Type primitives:FieldFormElementView}">
<StackPanel>
<TextBlock Text="{Binding Label}" Style="{StaticResource FeatureFormViewTitleStyle}"/>
<ContentControl Margin="0,3" Foreground="Gray" Content="{Binding}" x:Name="FieldInput" KeyboardNavigation.IsTabStop="False">
<ContentControl Margin="0,3" Foreground="Gray" Content="{Binding}" x:Name="FieldInput" KeyboardNavigation.IsTabStop="False"
>
Copy link

Copilot AI Sep 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ContentControl element appears incomplete. The opening tag has a dangling '>' on line 269 without any automation properties being added, unlike the similar ContentControl in the WinUI theme file which properly adds AutomationProperties.Name and AutomationProperties.HelpText.

Suggested change
>
AutomationProperties.Name="{Binding Label}"
AutomationProperties.HelpText="{Binding Hint}">

Copilot uses AI. Check for mistakes.
<ContentControl.ToolTip>
<ToolTip Content="{Binding Hint}">
<ToolTip.Style>
Expand Down
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AutomationName and HelpText to be set on TextInput TextBox in L#162 similar to WPF as
AutomationProperties.Name="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Element.Label}" AutomationProperties.HelpText="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Element.Description}"

To implemented for MaUI as well

Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,8 @@
<ControlTemplate TargetType="primitives:FieldFormElementView">
<StackPanel>
<TextBlock Text="{Binding Label}" Style="{StaticResource FeatureFormViewTitleStyle}"/>
<ContentControl Margin="0,3" Foreground="Gray" Content="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Element}" x:Name="FieldInput" IsTabStop="False" HorizontalContentAlignment="Stretch">
<ContentControl Margin="0,3" Foreground="Gray" Content="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Element}" x:Name="FieldInput" IsTabStop="False" HorizontalContentAlignment="Stretch"
AutomationProperties.Name="{Binding Label}" AutomationProperties.HelpText="{Binding Description}">
<ToolTipService.ToolTip>
<ToolTip Content="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Element.Hint}" Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Element.Hint, Converter={StaticResource FeatureFormViewVisibilityConverter}}" />
</ToolTipService.ToolTip>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ private static object BuildDefaultTemplate()
root.Children.Add(label);
var content = new ContentControl();
content.SetBinding(ContentControl.ContentDataProperty, static (FieldFormElementView view) => view.Element, source: RelativeBindingSource.TemplatedParent);
content.SetBinding(SemanticProperties.DescriptionProperty, static (FieldFormElementView view) => view.Element?.Label, source: RelativeBindingSource.TemplatedParent);
content.SetBinding(SemanticProperties.HintProperty, static (FieldFormElementView view) => view.Element?.Description, source: RelativeBindingSource.TemplatedParent);
root.Children.Add(content);
var errorLabel = new Label() { Margin = new Thickness(0, 2), TextColor = Colors.Red };
root.Children.Add(errorLabel);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ protected override void PrepareContainerForItemOverride(DependencyObject element
{
if (object.Equals(cv.Code, Element?.Value))
isChecked = true;
#if WPF
System.Windows.Automation.AutomationProperties.SetName(radio, cv.Name);
#endif
Comment on lines +94 to +96
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing implementation for WinUI

Suggested change
#if WPF
System.Windows.Automation.AutomationProperties.SetName(radio, cv.Name);
#endif
#if WPF
System.Windows.Automation.AutomationProperties.SetName(radio, cv.Name);
#elif WINUI
Microsoft.UI.Xaml.Automation.AutomationProperties.SetName(radio, cv.Name);
#endif

}
else if(item is RadioButtonNullValue && Element?.Value is null)
{
Expand Down
Loading