Windows Phone 8.1 Pivot custom header style

前端 未结 2 1821
执笔经年
执笔经年 2020-12-19 03:07

I\'m aiming to mimic similar effect as seen here: http://www.visuallylocated.com/post/2012/05/23/Changing-the-background-color-of-your-pivot-headers.aspx . There are resourc

2条回答
  •  时光取名叫无心
    2020-12-19 04:09

    If you just want to change the background color of all the headers, this is how you can do it in Window Phone 8.1.

    First, use Expression Blend to generate the default style of the Pivot control.

    19,38,0,0
    19,25,0,0
    
    

    Find this line below, the only change I have made to the default style is adding Background="{TemplateBinding BorderBrush}" to the PivotHeaderPanel which is the panel that hosts all the headers.

    
    

    The reason that I use TemplateBinding here is because doing this gives me the flexibility to change the headers background by specifying the BorderBush of the Pivot. As the BorderBrush is not used anywhere in the control, there won't be any side effect if we change it.

    So, all you need to do in your Pivot is this.

    
    

    This is how they look now.

    enter image description here

    Hope this helps!

提交回复
热议问题