Silverlight ChildWindow 无法正确重新定位
我正在使用 ChildWindow (Silverlight),它还包含一些扩展器控件。在一种情况下,当扩展器控件展开时,子窗口的底部会向下展开到底部的屏幕之外,但仍然在顶部留出空间。
如何重新定位子窗口以便将其置于屏幕中央,就像我刚刚打开子窗口一样? (这很容易,但我认为不可行)
(手动干预) 我已经完成了 ContentRoot 的 RenderTransform,并且该集合中有 6 个转换,其中 2 个是 TranslateTransform。如果我更新第一个的 X/Y 属性(不知道应该更改这两个属性中的哪一个)并使用整个 TransformGroup 更新 RenderTransform 属性,我可以成功地在屏幕上移动 ChildWindow - 但事实并非如此表现得像我期待的那样。
我也不知道为什么当 Expander 控件展开时,ChildWindow_SizeChanged 事件不会触发。窗口的大小确实发生了变化,那么为什么它不触发呢?
好的 - 问题太多了,只需要回答第一个问题,剩下的就是补充我对 WPF/Silverlight 是如何工作的知识...
问候, 理查德
I am using the ChildWindow (Silverlight) which also contains some expander controls. In one case, when the expander control expands, the bottom of the child window expands down out the screen on the bottom, but still leaves room on the top.
How can I re-position a child window in order to center it in the screen, as if I just opened the childwindow? (That would be easy, but I don't think doable)
(manual intervention)
I've gone through RenderTransform of the the ContentRoot, and I have six transforms in that collection, 2 of which are TranslateTransforms. If I update the X/Y properties of the first one (don't know which of the two I should be changing) AND update the RenderTransform property with the entire TransformGroup, I have success in moving the ChildWindow around the screen - but it's not behaving as I am expecting.
I also dont' know why the ChildWindow_SizeChanged event does not fire, when the Expander control expands. The window does change in size, so why does it not fire?
Ok - too many questions, just need the first one answered, the rest are to fill in my knowledge of how WPF/Silverlight is working...
Regards,
Richard
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通过此博客回答:http://www. kunal-chowdhury.com/2010/11/how-to-reposition-silverlight-child.html
}
Answer via this blog: http://www.kunal-chowdhury.com/2010/11/how-to-reposition-silverlight-child.html
}