4

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.

  • 1
    May be you can post a vary minimalistic code of your problem. – WPF-it Oct 26 '12 at 06:08
  • 1
    There is no code needed as example. It is a simple question! How can I set 2 or more properties (e.g. Height and Width as well as Top and Left) before the rendering thread starts to render. There is on my understanding no way to interact with the rendering thread. Why is this rendering thread completely hidden? – user1775841 Dec 05 '12 at 15:36
  • You can try to set your properties before `InitializeComponent();` call in your Window's constructor. – EugenSoft Dec 05 '12 at 15:41
  • 1
    InitializeComponent() makes no sense here, because I want to resize the Window. By the way create new WPF project under Microsoft Project, just place 1 Button control, align it to the right border and then try to resize. It is jittering already during resize. This is 1 control and Microsoft is not able with WPF to place 1 control smooth to the border. This is NOT acceptable! – user1775841 Dec 08 '12 at 00:25

0 Answers0