WPF Performance on Windows Vista/ Windows XP

WPF provides better performance under the Windows Vista operating system, where it can take advantage of the new Windows Vista Display Driver Model (WDDM). WDDM offers several important enhancements beyond the Windows XP Display Driver Model (XPDM). Most importantly, WDDM allows several graphics processing
unit (GPU) operations to be scheduled at once, and it allows video card memory to be paged to normal system memory if you exceed what’s available on the video card. WPF offers some sort of hardware acceleration to all WDDM (Windows Vista) drivers and to XPDM (Windows XP) drivers that were created after November 2004, which is when Microsoft released new driver development guidelines. Of course, the level of support differs. When the WPF infrastructure first starts up, it evaluates your video card and assigns it a rating from 0 to 2.

WPF is intelligent to use hardware optimizations where possible, but it has a software fallback for everything. So if you run a WPF application on a computer with a legacy video card, the interface will still appear the way you designed it. Of course, the software alternative may be much slower, so you’ll find that computers with older video cards won’t run rich WPF applications very well, especially ones that incorporate complex animations or other intense graphical effects.


The difference between Margin and Padding properties

Margin and Padding are two similar layout concepts that are often confused. Margin represents the amount of space around the outside of the element. This space ensures that the Element has room between it and neighboring elements. Padding functions differently. It is present on elements that inherit from Control  and allows the control to specify an amount of space inside itself. This inner space separates the control from its own content.  Take for example the Button control. The space inside the Button, around its text, that prevents the Button‘s border from shrinking to the size of its contents. Take a look at the below diagram which illustartes the differenece more.