How to suspend WPF Window to render before not all desired properties are set?

595 Views Asked by At

I have quite a simple question regarding the rendering thread in WPF and dotNet4.0. How can I avoid that the rendering thread is already starting to render before I have set all my dependency properties what I want to set. I like to set the new Height, Width and Left and Top Property of an WPF Window first completely before the rendering thread should start to render the new position and size of a window.

Background: I am designing at the moment a borderless Window where I do all the logic of resizing and positioning. When I now try to resize the Window by mouse on the left top corner or even the left border, then I have to set a new window size (Height, Width) and at the same time I have to set the new position using the Left and Top property. Unfortunately the rendering thread is already starting to render even if still not all new property values are set. This leads to a flickering of the window in different position before it is set finally on the correct new position and looks not nice.

I already researched a lot of question threads here, but no thread gives really the answer. Please Help!

Note: I think there is no code required, the problem is without code understandable and everyone can try this with the default window, to set is borderless.

0

There are 0 best solutions below