[英]Center Window on Resize using Caliburn Micro in WPF MVVM?
I am using Caliburn Micro, My UserControl(Window) is intially in Center Screen but as content loaded into it dynamically, its size increases. 我正在使用Caliburn Micro,我的UserControl(Window)最初位于中心屏幕中,但是随着内容动态加载到其中,其大小会增加。
So i want to make the window in Centre Screen when it resizes. 因此,我想在调整大小时在“中心屏幕”中创建窗口。
While I do not agree with the usability of moving a window in general, here is what you'd do to re-center your window if the window has been resized: 我通常不同意移动窗口的可用性,但是如果窗口已调整大小,则可以按照以下步骤重新放置窗口:
SizeChanged
event handler. 创建一个SizeChanged
事件处理程序。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.