Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/arduino/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows phone 7 工具包扩展器头背景更改_Windows Phone 7_Windows Phone Toolkit - Fatal编程技术网

Windows phone 7 工具包扩展器头背景更改

Windows phone 7 工具包扩展器头背景更改,windows-phone-7,windows-phone-toolkit,Windows Phone 7,Windows Phone Toolkit,我必须在单击时更改工具箱扩展器标题的背景,并且必须在展开时还原为原始背景色。我在代码中包含的可视化状态管理器对于超链接按钮来说运行良好。我该怎么做才能让它工作 <toolkit:ExpanderView x:Name="Header1" FontSize="22" Foreground="Black" Expanded="Header1_Expanded"> <toolkit:ExpanderView.Header> <Grid x:Name="Getti

我必须在单击时更改工具箱扩展器标题的背景,并且必须在展开时还原为原始背景色。我在代码中包含的可视化状态管理器对于超链接按钮来说运行良好。我该怎么做才能让它工作

<toolkit:ExpanderView x:Name="Header1" FontSize="22" Foreground="Black" Expanded="Header1_Expanded">
<toolkit:ExpanderView.Header>

    <Grid x:Name="GettinghereGrid" >
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition/>
        </Grid.RowDefinitions>

         <StackPanel Orientation="Horizontal" Background="#EBEBEB" x:Name="sp1">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Normal">
                    </VisualState>
                    <VisualState x:Name="Pressed">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="sp1">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="Red"/>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>

            <Image Source="/Assets/Menu/getting-here.png" Margin="8,0,0,0"  HorizontalAlignment="Left" Stretch="None"/>
            <TextBlock Text="{Binding Path=LocalizedResources.menu_getting_here, Source={StaticResource LocalizedStrings}}" VerticalAlignment="Center" Margin="10" FontSize="26" Foreground="Black" FontFamily="{StaticResource CustomLucidaGrandStyle}"/>
        </StackPanel>
        <Rectangle Height="2" Grid.Row="1" Fill="#D6D6D6D6" Width="500" />
    </Grid>


Thnx提前

使用MouseEnter、MouseLeave事件来展开视图

<toolkit:ExpanderView x:Name="Header3" FontSize="22" Foreground="Black" Expanded="Header3_Expanded" MouseEnter="Header_MouseEnter" MouseLeave="Header_MouseLeave">
    private void Header_MouseEnter(object sender, MouseEventArgs e)
    {
        SolidColorBrush sb = new SolidColorBrush();
        sb.Color = Color.FromArgb(170, 170, 170, 170);
        WhattodoGrid.Background = sb;
    }
    private void Header_MouseLeave(object sender, MouseEventArgs e)
    {
        SolidColorBrush sb = new SolidColorBrush();
        sb.Color = Color.FromArgb(0,0,0,0);
        WhattodoGrid.Background = sb;
    }