问题
Pivot Control Black Box
The goal is to change the color of the black border around my Pivot control.
I created a copy of the template for the pivot control so I can modify the style. It isn't obvious how to modify the style to change the color of the this black brush.
Added Border Brush - I looked at BorderBrush but it doesn't really feel like change?
Where and how - to best achieve the changing of a border color? The red dotted boxes are not changing the color.
回答1:
The black border in your picture is actually the auxiliary border after the focus switch. Setting its color cannot be done by BorderBrush
.
Please find the ContentControl
named HeaderClipper in Pivot's default style template and add the following properties:
<ContentControl x:Name="HeaderClipper"
FocusVisualPrimaryBrush="{TemplateBinding FocusVisualPrimaryBrush}"
...>
<!-- other code -->
</ContentControl/>
Then set the FocusVisualPrimaryBrush
property on the Pivot
control to the color you need:
<Pivot FocusVisualPrimaryBrush="White">
<!-- other code -->
</Pivot>
If you want to learn more about Focus
, you can refer to this document: Reveal Focus
来源:https://stackoverflow.com/questions/60512958/pivot-xaml-control-changing-the-style-border