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


C# DoubleAnimation.SetTarget方法代码示例

本文整理汇总了C#中System.Windows.Media.Animation.DoubleAnimation.SetTarget方法的典型用法代码示例。如果您正苦于以下问题:C# DoubleAnimation.SetTarget方法的具体用法?C# DoubleAnimation.SetTarget怎么用?C# DoubleAnimation.SetTarget使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Media.Animation.DoubleAnimation的用法示例。


在下文中一共展示了DoubleAnimation.SetTarget方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DialogPanelShow

		public void DialogPanelShow(bool bShow)
		{
			if (bShow) // force visibility since you can't animate the Visible property
			{
				m_this.Visibility = Visibility.Visible;
				if (m_BackgroundElement != null)
					m_BackgroundElement.Visibility = Visibility.Visible;
			}

			Storyboard storyBoard = new Storyboard();
//j			m_this.Resources.Add("SomeSortofKeyName", storyBoard);

			DoubleAnimation animation = new DoubleAnimation();
			animation.From = (bShow ? 0 : 1);
			animation.To = (bShow ? 1 : 0);
			animation.Duration = TimeSpan.FromSeconds(0.5);
			animation.SetTarget(m_RootDialogElement);
			animation.SetTargetProperty("(UIElement.Opacity)");
			storyBoard.Children.Add(animation);
			if (bShow) storyBoard.Completed += ShowCompleted; else storyBoard.Completed += HideCompleted;
			storyBoard.Begin();
		}
开发者ID:,项目名称:,代码行数:22,代码来源:

示例2: GetGenericAnimation

 /// <summary>
 /// 
 /// </summary>
 /// <param name="from"></param>
 /// <param name="to"></param>
 /// <param name="millis"></param>
 /// <param name="easingFunction"></param>
 /// <param name="target"></param>
 /// <returns></returns>
 private static DoubleAnimation GetGenericAnimation(double from, double to, double millis, IEasingFunction easingFunction, UIElement target = null)
 {
     DoubleAnimation d = new DoubleAnimation();
     d.EasingFunction = easingFunction;
     d.Duration = TimeSpan.FromMilliseconds(millis);
     d.From = from;
     d.To = to;
     d.SetTarget(target);
     return d;
 }
开发者ID:ireynolds,项目名称:Document-Store,代码行数:19,代码来源:AnimationUtils.cs


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