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


C# DoubleAnimation.SetTargetProperty方法代码示例

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


在下文中一共展示了DoubleAnimation.SetTargetProperty方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: FadeAnimation

		private DoubleAnimation FadeAnimation(bool forward)
		{
			DoubleAnimation animation = new DoubleAnimation();
			//animation.EasingFunction = EasingFunction;
			//animation.BeginTime = (forward ? TimeSpan.FromSeconds(DelayForward) : TimeSpan.FromSeconds(DelayReverse));
			//animation.Duration = (forward ? TimeSpan.FromSeconds(SecondsForward) : TimeSpan.FromSeconds(SecondsReverse));
			animation.Duration = TimeSpan.FromSeconds(1);
			//animation.From = (forward ? 0 : 1);
			animation.To = (forward ? 1 : 0);
			animation.SetTargetProperty("Opacity");
			return animation;
		}
开发者ID:,项目名称:,代码行数:12,代码来源:

示例3: TranslateAnimation

		private DoubleAnimation TranslateAnimation(bool forward, bool horizontal, double offset)
		{
			DoubleAnimation animation = new DoubleAnimation();
			animation.EasingFunction = (forward ? EasingFunctionForward : EasingFunctionReverse);
			animation.BeginTime = (forward ? TimeSpan.FromSeconds(DelayForward) : TimeSpan.FromSeconds(DelayReverse));
			animation.Duration = (forward ? TimeSpan.FromSeconds(SecondsForward) : TimeSpan.FromSeconds(SecondsReverse));
			//animation.From = (forward ? offset : 0);
			animation.To = (forward ? 0 : offset);
			string target = (horizontal ? "X" : "Y");
			animation.SetTargetProperty(string.Format("(UIElement.RenderTransform).(TransformGroup.Children)[1].(TranslateTransform.{0})", target));
			return animation;
		}
开发者ID:,项目名称:,代码行数:12,代码来源:

示例4: ScaleAnimation

		private DoubleAnimation ScaleAnimation(bool forward, bool horizontal, double scale)
		{
			DoubleAnimation animation = new DoubleAnimation();
			animation.EasingFunction = EasingFunction;
			animation.BeginTime = (forward ? TimeSpan.FromSeconds(DelayForward) : TimeSpan.FromSeconds(DelayReverse));
			animation.Duration = (forward ? TimeSpan.FromSeconds(SecondsForward) : TimeSpan.FromSeconds(SecondsReverse));
			//animation.From = 0;
			animation.To = (forward ? 1 : scale);
			string target = (horizontal ? "X" : "Y");
			animation.SetTargetProperty(string.Format("(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.Scale{0})", target));
			return animation;
		}
开发者ID:,项目名称:,代码行数:12,代码来源:


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