hi,all
Please answer me.
i have wpf window which contains buttons and datagrid etc controls,when i click the button to open another wpf window.it's fine.,but opening another wpf window takes the so much of the time.why? any performance problems are there?
I have wpf window which contains buttons and datagrid etc
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.


Mamta MRank #268 · 9.4K reputationPosted Apr 23, 2012, 8:35 PM EDT
Ways to speed up your window loading:
1) Use the following code, wherein you halt the Dispatcher temporarily and take care of the screen loading and then again resume the normla operations.
var dis = Dispatcher.DisableProcessing();
/* Perform your time-consuming screen loading work here, such as filling data, retrieving data from database into the window controls... Use dispacher.begininvoke... */
dis.Dispose();
2) Read this article for better understanding and implement this approach:
http://msdn.microsoft.com/en-us/magazine/cc163328.aspx
Hope this helps.