1、WPF数据采集和监控(Industrial)
特记要点:
-
属性路径
Background.(SolidColorBrush.Color)直接绑定控件的画刷的颜色,这种绑定方式只适合动画路径绑定。<ToggleButton.Style> <Style TargetType="ToggleButton"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="ToggleButton"> <Border x:Name="Part_Back" Background="DeepSkyBlue" CornerRadius="3"> </Border> <ControlTemplate.Triggers> <Trigger Property="IsChecked" Value="True"> <Trigger.EnterActions> <BeginStoryboard> <ColorAnimation To="Orange" Storyboard.TargetName="Part_Back" Storyboard.TargetProperty="Background.(SolidColorBrush.Color)"></ColorAnimation> </Storyboard> </BeginStoryboard> </Trigger.EnterActions> <Trigger.ExitActions> <BeginStoryboard> <ColorAnimation To="DeepSkyBlue" Storyboard.TargetName="Part_Back" Storyboard.TargetProperty="Background.(SolidColorBrush.Color)"></ColorAnimation> </Storyboard> </BeginStoryboard> </Trigger.ExitActions> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style> </ToggleButton.Style>
