I have a Grouped GridView in my app. I'd like to set AutomationProperties.Name
on the GridViewHeaderItem
object, which I can do using a <Style>
like the following:
<Style x:Key="GridViewHeaderStyle" TargetType="GridViewHeaderItem">
<Setter Property="AutomationProperties.Name" Value="This Works" />
</Style>
The following does NOT work, regardless of what I bind to:
<Style x:Key="GridViewHeaderStyle" TargetType="GridViewHeaderItem">
<Setter Property="AutomationProperties.Name" Value="{Binding DataContext.PropertyDoesNotWork}" />
</Style>
How can I set the AutomationProperties.Name
at run-time? Is there some event that is fired when the GridViewHeaderItem
object is created?
Thank you.