回复 4楼roger.wang的帖子
您好!我的仪表盘可以显示了。我想让仪表盘的指针在启动时从开始转到指定位置有一个动画,这个如何实现啊?- <UserControl x:Class="GaugeSamples.RadialGauge"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:c1="http://schemas.componentone.com/winfx/2006/xaml"
- >
- <UserControl.Resources>
- <Storyboard x:Name="AnimateRadial">
- <DoubleAnimationUsingKeyFrames RepeatBehavior="Forever" BeginTime="00:00:00" Duration="00:00:02" AutoReverse="True" Storyboard.TargetName="myGauge" Storyboard.TargetProperty="(c1Gaugeauge.Value)">
- <SplineDoubleKeyFrame KeyTime="00:00:5.00" Value="500" KeySpline="0,0,1,0"/>
- </DoubleAnimationUsingKeyFrames>
- </Storyboard>
- </UserControl.Resources>
-
- <c1:C1RadialGauge x:Name="myGauge"
- Height="500"
- Value="0" StartAngle="200" AllowDrop="True" Background="White" BorderThickness="0" FlowDirection="LeftToRight" SweepAngle="300" AspectRatio="1.5" Maximum="1000" >
- <c1:C1GaugeRange x:Name="myGR1" To="800" Location="0.8" Fill="Green" Stroke="Black" StrokeThickness="1" Width="0.2" Opacity="0.6" />
- <c1:C1GaugeRange x:Name="myGR2" From ="800" To="900" Location="0.8" Fill="Orange" Stroke="Black" StrokeThickness="1" Width="0.2" Opacity="0.6" />
- <c1:C1GaugeRange x:Name="myGR3" From="900" Fill="Red" Location="0.8" Stroke="Black" StrokeThickness="1" Width="0.2" Opacity="0.6" />
- <c1:C1GaugeMark x:Name="myGM1" Interval="200" />
- <c1:C1GaugeMark x:Name="myGM2" Interval="100" />
- <c1:C1GaugeMark x:Name="myGM3" Interval="10" />
-
- <c1:C1GaugeLabel x:Name="myGaugeLabel" Interval="200" Alignment="Out" AlignmentOffset="20" />
- </c1:C1RadialGauge>
- </UserControl>
复制代码 |