本文介绍了以编程方式在WPF中创建偏斜变换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想以编程方式在WPF中创建一个偏斜转换,以便打开时窗口翻转.我已经使用以下代码创建了一个淡入淡出的动画公共 静态 void FadeIn(此 UIElement targetControl) { DoubleAnimation fadeInAnimation = 新 DoubleAnimation( 0 , 1 ,新持续时间(TimeSpan.FromSeconds( 1 . 5 )))); Storyboard.SetTarget(fadeInAnimation,targetControl); Storyboard.SetTargetProperty(fadeInAnimation,新 PropertyPath(UIElement.OpacityProperty)); 情节提要sb = 新情节提要(); sb.Children.Add(fadeInAnimation); sb.Begin(); }
我想使倾斜方法与上述相同,并且也位于标题上方,因此当我调用此函数时边框不具有动画效果
像这样
公共 部分 class childWindow1:窗口 { 公共 childWindow1() { InitializeComponent(); 此 .FadeIn(); }
解决方案
i want to create a skew transformation in WPF programatically so that window flip when open. i have create a fadein animation using the following code
public static void FadeIn(this UIElement targetControl) { DoubleAnimation fadeInAnimation = new DoubleAnimation(0, 1, new Duration(TimeSpan.FromSeconds(1.5))); Storyboard.SetTarget(fadeInAnimation, targetControl); Storyboard.SetTargetProperty(fadeInAnimation, new PropertyPath(UIElement.OpacityProperty)); Storyboard sb = new Storyboard(); sb.Children.Add(fadeInAnimation); sb.Begin(); }
an i wanted to make a skew method same as above and also in above the tittle and the border is not animated when i call this function
like this
public partial class childWindow1 : Window { public childWindow1() { InitializeComponent(); this.FadeIn(); }
解决方案
这篇关于以编程方式在WPF中创建偏斜变换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!