Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there are any loading speed difference between Page and Window in WPF?

I want to load 10 000 items in a DataGrid in WPF. When using a Window control the data loads faster than when using a Page control. Can someone explain why?

like image 863
Nadeem Avatar asked Mar 01 '12 06:03

Nadeem


1 Answers

Pages are intended for use in Navigation applications (usually with Back and Forward buttons, e.g. Internet Explorer). Pages must be hosted in a NavigationWindow or a Frame

Windows are just normal WPF application Windows [lnk]

This is essentially an XBAP vs ClickOnce problem. Anything in a Page is compiled for and restricted by what WPF is permitted to do in a browser window. This precludes many low level computer operations that WPF Windows can get away with because they are compiled to run from the desktop. Window apps have full access to system resources.

Keep in mind that when you use a Page control, even during debugging, the generated code is build with a browser deployment in mind. All XBAPs are run in a restrictive security sandbox under partial trust. In other words, they are allowed to use certain .NET libraries but banned from accessing others. [ref] Some of these .NET libraries will be responsible for optimizations that therefore can't achieved in a browser deployment.

As such, it makes perfect sense that applications build in Windows would be able to perform most operations faster than apps built in Pages.

like image 177
Alain Avatar answered Dec 03 '22 19:12

Alain