c# - 毫无意义的问题。可以删除
问题描述
这是原始帖子的链接:为 WPF 窗口宽度和高度设置动画。感谢您提供的示例。代码效果很好。但仅限于主窗口。如果我创建一个子窗口。ChildWnd cw = new ChildWnd(); cw.Owner = 这个;cw.Show(); 我将所有代码相同地粘贴到此窗口中。动画不起作用。没有错误,也没有动画。请帮助解决这个问题。我不擅长编组。但这对我的项目非常重要。
解决方案
哦,谢谢,我已经明白了。需要将第三个参数在两个地方替换为子窗口的类名。DependencyProperty WindowHeightAnimationProperty 和 WindowWidthAnimationProperty:
public static readonly DependencyProperty WindowHeightAnimationProperty = DependencyProperty.Register("WindowHeightAnimation", typeof(double), typeof(ChildWnd), new PropertyMetadata(OnWindowHeightAnimationChanged));
推荐阅读
- excel - 使用另一列上的条件计算 excel 中的不同值
- redux - 如何将 Redux 状态转换为 Angular 视图 Observable?
- angular - 如何在角度材料选择中订购方法调用
- microservices - xxx.azurewebsites.net 当前无法处理此请求
- python - 有没有一种优雅的方法可以在pytest中通过python处理oracle连接?
- python - Python列表平均值
- google-chrome - Chrome 使地图空白。Safari、Edge 和 Firefox 有效
- jquery - 如何使用 javascript 将刀片语句附加到 div?
- mysql - 在 SQL 的日期时间中添加时区偏移量
- swift - 背景音乐,我的音乐相互重叠,我想让音乐循环播放