【问题标题】:The pointless question. It can be deleted毫无意义的问题。可以删除
【发布时间】:2020-04-22 19:48:39
【问题描述】:

这里是原始帖子的链接:Animating a WPF window width and height。感谢您提供的示例。代码效果很好。但仅限于主窗口。如果我创建一个子窗口。 ChildWnd cw = new ChildWnd(); cw.Owner = 这个; cw.Show();我将所有代码相同地粘贴到此窗口中。动画不起作用。没有错误,也没有动画。请帮助解决这个问题。我不擅长编组。但这对我的项目非常重要。

【问题讨论】:

    标签: c# wpf animation marshalling mainwindow


    【解决方案1】:

    哦,谢谢,我已经明白了。需要将第三个参数在两个地方替换为子窗口的类名。 DependencyProperty WindowHeightAnimationProperty 和 WindowWidthAnimationProperty:

    public static readonly DependencyProperty WindowHeightAnimationProperty = DependencyProperty.Register("WindowHeightAnimation", typeof(double), typeof(ChildWnd), new PropertyMetadata(OnWindowHeightAnimationChanged));

    【讨论】:

      猜你喜欢
      • 2022-11-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-04-30
      • 1970-01-01
      • 1970-01-01
      • 2012-10-17
      • 2014-12-27
      相关资源
      最近更新 更多