8,737
社区成员
发帖
与我相关
我的任务
分享
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="TextBlock">
<VisualStateManager.VisualStateGroups >
<VisualState x:Name="Normal">
<Storyboard> …………………… </Storyboard>
</VisualState>
</VisualStateManager.VisualStateGroups>
</ControlTemplate>
</Setter.Value>
</Setter>
<Storyboard x:Name="tbkAnimation">
<ColorAnimationUsingKeyFrames BeginTime="00:00:00"
Storyboard.TargetName="PTitle"
Storyboard.TargetProperty="(TextBlock.Foreground).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
<EasingColorKeyFrame KeyTime="00:00:01" Value="Red"/>
<EasingColorKeyFrame KeyTime="00:00:02" Value="Orange"/>
<EasingColorKeyFrame KeyTime="00:00:03" Value="Red"/>
</ColorAnimationUsingKeyFrames>
<ColorAnimationUsingKeyFrames BeginTime="00:00:00"
Storyboard.TargetName="PTitle"
Storyboard.TargetProperty="(TextBlock.Foreground).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
<EasingColorKeyFrame KeyTime="00:00:01" Value="Purple"/>
<EasingColorKeyFrame KeyTime="00:00:02" Value="Red"/>
<EasingColorKeyFrame KeyTime="00:00:03" Value="Purple"/>
</ColorAnimationUsingKeyFrames>
</Storyboard>
<TextBlock x:Name="PTitle" Text="空気の物性値表" Margin="4,4,4,4" Style="{StaticResource TextblockStyle}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="LayoutRoot_Loaded">
<ei:ControlStoryboardAction Storyboard="{StaticResource tbkAnimation}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</TextBlock>
<!-- 设置全局的 TextBlock 对DataGrid等影响较大,故加上Key-->
<Style TargetType="TextBlock">
<Setter Property="FontSize" Value="12"/>
</Style>
<Style x:Key="tbNormalStyle" TargetType="TextBlock">
<Setter Property="TextAlignment" Value="Right"/>
<Setter Property="Margin" Value="8,4,4,8"/>
<Setter Property="Padding" Value="4,3,8,0"/>
<Setter Property="FontSize" Value="12"/>
<Setter Property="Height" Value="23"/>
</Style>
<Style x:Key="tbLeftStyle" TargetType="TextBlock">
<Setter Property="TextAlignment" Value="Left"/>
<Setter Property="Margin" Value="8,4,4,4"/>
<Setter Property="Padding" Value="8,3,4,0"/>
<Setter Property="FontSize" Value="12"/>
<Setter Property="Height" Value="23"/>
</Style>
<Style x:Key="tbLeftWrapStyle" TargetType="TextBlock">
<Setter Property="TextAlignment" Value="Left"/>
<Setter Property="Margin" Value="8,4,4,4"/>
<Setter Property="Padding" Value="8,3,4,0"/>
<Setter Property="FontSize" Value="12"/>
<Setter Property="TextWrapping" Value="Wrap"/>
</Style>