解决方案 »

  1.   

    代码贴错了,复制多了...不好意思.只有下面这一点.                <TabItem.Style>
                        <Style TargetType="{x:Type TabItem}">
                            <Setter Property="Template">
                                <Setter.Value>
                                    <ControlTemplate TargetType="{x:Type TabItem}">
                                        <ControlTemplate.Resources>
                                            <Storyboard x:Key="Storyboard1">
                                                <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)"
     Storyboard.TargetName="sp">
                                                    <EasingColorKeyFrame KeyTime="0" Value="White"/>
                                                    <EasingColorKeyFrame KeyTime="0:0:0.2" Value="#FFFFCE4E"/>
                                                </ColorAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </ControlTemplate.Resources>
                                        <StackPanel x:Name="sp" Background="White">
                                            <Image Width="84" Height="70" Source="/Images/TabIcon/3.png" Margin="0,0,0,0" ></Image>
                                            <Label Content="警报管理" HorizontalAlignment="Center"/>
                                        </StackPanel>
                                        <ControlTemplate.Triggers>
                                            <Trigger Property="IsSelected" Value="True">
                                                <Trigger.EnterActions>
                                                    <BeginStoryboard Storyboard="{StaticResource Storyboard1}"/>
                                                </Trigger.EnterActions>
                                                <Setter TargetName="sp" Property="Background" Value="#FFFFCE4E"></Setter>
                                            </Trigger>
                                        </ControlTemplate.Triggers>
                                    </ControlTemplate>
                                </Setter.Value>
                            </Setter>
                        </Style>
                    </TabItem.Style>
      

  2.   

    请问如何把这个style写成通用的啊,图片由具体的时候再定.希望大家给点建议和方法
      

  3.   

    我说的不够详细吗?我就是想把这一行<Image Width="84" Height="70" Source="/Images/TabIcon/3.png" Margin="0,0,0,0" ></Image>
    写的更加具有适用性,能够根据具体的按钮改图片
      

  4.   

    可以做一个用户控件 控件添加属性去绑定图片,TabItem的模版就是这个用户空间
      

  5.   

    同问这个问题,能否给个demo啊。
      

  6.   

    谁解决了么   给个demo吧...