0

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.

Kishore Kumar
  • 12,675
  • 27
  • 97
  • 154
  • 1
    While this idea may sound good at first, the real-world usability is awful. What will happen when the user moves the window to a different area of the screen and then more content is loaded into the window? Should the window move back to the center of the screen? – Metro Smurf May 30 '12 at 18:17
  • So when does it move to the centre of the screen? – devdigital May 30 '12 at 19:23
  • i have an grouped datagrid.. when i expand that datagrid rows.its size gets changed. at that time, i need to update the window to centre – Kishore Kumar May 31 '12 at 11:54

1 Answers1

4

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
Community
  • 1
  • 1
Metro Smurf
  • 37,266
  • 20
  • 108
  • 140