简体   繁体   中英

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.

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:

  1. Create a SizeChanged event handler.
  2. In the event handler, re-center the window

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM