当前位置: 首页>>代码示例>>C#>>正文


C# DoubleAnimation.SetValue方法代码示例

本文整理汇总了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()); //到处都有你的身影
        }
开发者ID:SuperMap,项目名称:iClient-for-Win8,代码行数:29,代码来源:TiledLayer.cs

示例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();
     }
 }
开发者ID:XamlBrewer,项目名称:UWP-Floating-Content-Sample,代码行数:17,代码来源:FloatingContent.cs

示例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);
        }
开发者ID:CatalystCode,项目名称:radial-menu,代码行数:27,代码来源:PieSlice.xaml.cs

示例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();
     }
 }
开发者ID:XamlBrewer,项目名称:UWP-Floating-Content-Sample,代码行数:21,代码来源:FloatingContent.cs


注:本文中的Windows.UI.Xaml.Media.Animation.DoubleAnimation.SetValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。