神奇的动态改变画刷
开发工具与关键技术:Visual Studio + WPF
撰写时间:2019年5月22日
1、 动画是WPF中的一个亮点,现在跟大家分享一个好看的动画——动态改变画刷,在这个Ellipse圆形动画中使用ColorAnimation属性标签改变颜色,使用PointAnimatin属性标签改变横纵坐标。
<Window x:Class="Wpf2.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="动态改变画刷" Height="350" Width="525">
<Window.Triggers>
<!--BeginStoryboard:要在EventTrigger中触发调用,RoutedEvent是响应的事件-->
<EventTrigger RoutedEvent="Window.Loaded">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard>
<