更改 Windows Phone 8 中每个枢轴项的颜色 [英] change the color of each pivot item in windows phone 8

查看:37
本文介绍了更改 Windows Phone 8 中每个枢轴项的颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为 windows 8 的枢轴控件的每个枢轴项分配不同的颜色.

I want to assign the different colors to each pivot item of pivot control of windows 8.

红色代表所有,绿色代表分配.我如何实现它??

Red color for all, green for assigned. How do i achieve it??

 <Grid x:Name="LayoutRoot" Background="#FF0B345A">
    <!--Pivot Control-->
    <phone:Pivot Title="MY TASKS">
        <!--Pivot item one-->            
        <phone:PivotItem  Header="all">                           
            <Grid>                    
                <Grid.RowDefinitions>
                    <RowDefinition Height="auto"></RowDefinition>
                    <RowDefinition Height="auto"></RowDefinition>
                    <RowDefinition Height="auto"></RowDefinition>
                    <RowDefinition Height="*"></RowDefinition>
                </Grid.RowDefinitions>


                <StackPanel Margin="0,25,0,0" Grid.Row="0">

                    <TextBlock Text="Due Today 12:00PM" Foreground="#FF4472A2"></TextBlock>
                </StackPanel>

                <StackPanel Margin="0,25,0,0" Grid.Row="1">
                       <TextBlock Text="Sales On-Boarding" Foreground="#FFB7BEC6"></TextBlock>
                    <TextBlock Text="Due 9/25/13" Foreground="#FF4472A2"></TextBlock>
                </StackPanel>
            </Grid>               
        </phone:PivotItem>

        <!--Pivot item two-->
        <phone:PivotItem Header="assigned">
            <Grid/>
        </phone:PivotItem>
        <!--Pivot item three-->
        <phone:PivotItem Header="overdue">
            <Grid/>
        </phone:PivotItem>
    </phone:Pivot>
</Grid>

推荐答案

试试这个

    <Grid x:Name="LayoutRoot" Background="#FF0B345A">
        <!--Pivot Control-->
        <phone:Pivot Title="MY TASKS">
            <!--Pivot item one-->            
            <phone:PivotItem>    
 <controls:PivotItem.Header>
                        <Grid  Background="Red">
                            <TextBlock Name="allRecords" Text="all"  />
                        </Grid>
                    </controls:PivotItem.Header>                       
                <Grid>                    
                    <Grid.RowDefinitions>
                        <RowDefinition Height="auto"></RowDefinition>
                        <RowDefinition Height="auto"></RowDefinition>
                        <RowDefinition Height="auto"></RowDefinition>
                        <RowDefinition Height="*"></RowDefinition>
                    </Grid.RowDefinitions>


                    <StackPanel Margin="0,25,0,0" Grid.Row="0">

                        <TextBlock Text="Due Today 12:00PM" Foreground="#FF4472A2"></TextBlock>
                    </StackPanel>

                    <StackPanel Margin="0,25,0,0" Grid.Row="1">
                           <TextBlock Text="Sales On-Boarding" Foreground="#FFB7BEC6"></TextBlock>
                        <TextBlock Text="Due 9/25/13" Foreground="#FF4472A2"></TextBlock>
                    </StackPanel>
                </Grid>               
            </phone:PivotItem>

            <!--Pivot item two-->
            <phone:PivotItem>
<controls:PivotItem.Header>
                        <Grid Background="Red">
                            <TextBlock Name="assignedRecords" Text="assigned"  />
                        </Grid>
                    </controls:PivotItem.Header>  
                <Grid/>
            </phone:PivotItem>
            <!--Pivot item three-->
            <phone:PivotItem>
<controls:PivotItem.Header>
                        <Grid Background="Red">
                            <TextBlock Name="overdueRecords" Text="overdue"  />
                        </Grid>
                    </controls:PivotItem.Header>  
                <Grid/>
            </phone:PivotItem>
        </phone:Pivot>
    </Grid>

这篇关于更改 Windows Phone 8 中每个枢轴项的颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆