views:

1304

answers:

5

I am relatively new in the WPF world and one thing I immediately noticed is how laggy the window content is drawn when you resize a window. For example if you have scrollbars at the window edges those scrollbars will be partly hidden while shrinking and have space between them and the window border when enlarging.

This even happens with an empty WPF project created in Visual Studio. What's even worse is that it also happens with the background and you can see stuff behind the window (other windows, desktop wallpaper, etc.) leak through when enlarging.

At first I thought that it's an ugly limitation of WPF seeing that native or WinForms applications resize just fine (if written properly). But when I look at Expression Blend the window background stays opaque (though the window content still lags behind). What do they do to prevent described problem and are there any ways to improve resizing to more approximate native/WinForm GUIs?

+1  A: 

Are you running Vista without SP1 ? From what I have read, this was a common issue that is supposed have been fixed..

http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/3960d6a6-e873-455c-9ddc-1e2dd32e090b/

markt
Yep, I do. And as I've said Expression Blend doesn't seem to have that problem. Do you have any additional pointers to that "common issue" you spoke of?
gix
Sorry confused -- I had read that this was fixed between Vista and Vista SP1.
markt
How about .Net 3.5 SP1? There was a lot or work done with WPF performance in 3.5 Sp1.
Russ
A: 

I'm not seeing this behavior, myself. I develop on vista x64 sp1 and/or a virtual pc running xp x32 sp3. Wpf uses directx, could it be your video card/machine? Try running your app on a diff machine and see if you have the same results.

Muad'Dib
I'm running Vista64 SP1 myself, Aero enabled. Using vista-basic theme (aero disabled) I don't seem to get it (or it's barely noticeable). In Server 2008 R2 in VBox and in Server 2008 on my laptop both with the basic theme I don't see it at all. Maybe because my machine is a lot faster than those.
gix
A: 

I have the same issue with the interface lagging while resizing. I suspect that the reason for the lag is it is resizing the underlying frame buffers in direct X which is never particularly fast. I am not sure what you can do about it though.

Caleb Vear
A: 

I've been looking for information on this issue as well. I just thought it was a windows "feature" that some intrepid microsoft programmer thought would be cool. I was hoping to be able to turn it off so that window resizes would actually follow my mouse, instead of lagging and then overshooting. Grr.

+2  A: 

The reason of lags is nicely explained here

Tomáš Kafka