當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。