Pivot XAML Control - Changing the Style (Border)

旧街凉风 提交于 2020-04-30 10:19:27

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!