-
-
Notifications
You must be signed in to change notification settings - Fork 520
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automation problem in v7 #674
Comments
So in <ContentControl AutomationProperties.Name="{TemplateBinding Header}"
AutomationProperties.AutomationId="{TemplateBinding Name}"
Content="{TemplateBinding Header}"
ContentTemplate="{TemplateBinding HeaderTemplate}"
... Perhaps you should instead set |
I found a really hacky solution: <Style TargetType="{x:Type fluent:RibbonTabItem}" BasedOn="{StaticResource RibbonTabItemStyle}">
<Setter Property="HeaderTemplate">
<Setter.Value>
<DataTemplate>
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Text="{Binding}" TextWrapping="NoWrap" TextTrimming="None"
AutomationProperties.AutomationId="{Binding Path=(AutomationProperties.AutomationId),RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type ContentControl}}}"/>
</DataTemplate>
</Setter.Value>
</Setter>
</Style> Please consider a better fix. E.g. setting |
Adding a custom automation peer for |
Cool! The automation peer will make life easier! |
Consider the following tab item:
In older versions (v3.6) the
AutomationId
of the underlyingLabel
element (below thePART_ContentContainer
) was set tohomeTabItem
. This behavior changed a bit in v7. Now, there is noLabel
. Instead, there is aContentControl
(withAutomationId
set) but its underlyingTextBlock
has noAutomationId
. This implies that tools such as Microsoft Inspect cannot see the text element. Only the tab item is visible.Ideally, the
TextBlock
would get the sameAutomationId
as theRibbonTabItem
. Not sure how to propagate the value. NeitherTemplateBinding
norBinding... TemplatedParent
works.I believe the major problem is that the
RibbonTabItem
doesn't show up inInspect
.Environment
The text was updated successfully, but these errors were encountered: