本文整理汇总了C#中Windows.UI.Xaml.Media.Animation.DoubleAnimation.SetValue方法的典型用法代码示例。如果您正苦于以下问题:C# DoubleAnimation.SetValue方法的具体用法?C# DoubleAnimation.SetValue怎么用?C# DoubleAnimation.SetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Windows.UI.Xaml.Media.Animation.DoubleAnimation
的用法示例。
在下文中一共展示了DoubleAnimation.SetValue方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ShowImage
private void ShowImage(Image img, bool enableFading)
{
if (enableFading)
{
DoubleAnimation animation = new DoubleAnimation
{
From = new double?(img.Opacity),
To = 1.0,
Duration = TimeSpan.FromSeconds(0.5)
};
animation.SetValue(Storyboard.TargetPropertyProperty, "Opacity");
Storyboard storyboard = new Storyboard();
storyboard.Children.Add(animation);
Storyboard.SetTarget(animation, img);
storyboard.Completed += (s, e) =>
{
DispatchedHandler handler = new DispatchedHandler(delegate { base.OnProgress(this.GetProgress()); });
base.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, handler);
};
storyboard.Begin();
}
else
{
img.Opacity = 1.0;
}
base.OnProgress(this.GetProgress()); //到处都有你的身影
}
示例2: Border_ManipulationStarted
private void Border_ManipulationStarted(object sender, ManipulationStartedRoutedEventArgs e)
{
if (this.overlay != null)
{
var ani = new DoubleAnimation()
{
From = 0.0,
To = 1.0,
Duration = new Duration(TimeSpan.FromSeconds(1.5))
};
var storyBoard = new Storyboard();
storyBoard.Children.Add(ani);
Storyboard.SetTarget(ani, overlay);
ani.SetValue(Storyboard.TargetPropertyProperty, "Opacity");
storyBoard.Begin();
}
}
示例3: SetupIndicationArc
private void SetupIndicationArc()
{
var indicationArcRadius = Radius - OuterArcThickness - IndicationArcDistanceFromEdge;
IndicationArc.Size = new Size(indicationArcRadius, indicationArcRadius);
double startAngle = (StartAngle + .10 * Angle) * (Math.PI / 180),
endAngle = (StartAngle + .90 * Angle) * (Math.PI / 180);
double startX = Radius + indicationArcRadius * Math.Sin(startAngle),
startY = Radius - indicationArcRadius * Math.Cos(startAngle),
endX = Radius + indicationArcRadius * Math.Sin(endAngle),
endY = Radius - indicationArcRadius * Math.Cos(endAngle);
IndicationArcPathFigure.StartPoint = new Point(startX, startY);
IndicationArc.Point = new Point(endX, endY);
IndicationArcPath.StrokeThickness = IndicationArcStrokeThickness;
IndicationArcPath.Stroke = new SolidColorBrush(IndicationArcColor);
// make all arcs initiall invisibile
IndicationArcPath.Opacity = 0.0;
var appearAnimation = new DoubleAnimation()
{
From = 0.0,
To = 1.0,
};
appearAnimation.SetValue(Storyboard.TargetNameProperty, "IndicationArcPath");
appearAnimation.SetValue(Storyboard.TargetPropertyProperty, "Opacity");
InnerReleasedStoryBoard.Stop();
InnerReleasedStoryBoard.Children.Add(appearAnimation);
}
示例4: FlashOverlay
/// <summary>
/// Briefly shows the overlay, to indicate floating ability.
/// </summary>
private void FlashOverlay()
{
if (this.overlay != null)
{
var ani = new DoubleAnimation()
{
From = 0.0,
To = 1.0,
Duration = new Duration(TimeSpan.FromSeconds(1.0)),
AutoReverse = true
};
var storyBoard = new Storyboard();
storyBoard.Children.Add(ani);
Storyboard.SetTarget(ani, overlay);
ani.SetValue(Storyboard.TargetPropertyProperty, "Opacity");
storyBoard.Begin();
}
}