WPF的提高性能的控制负载的资源

WPF的提高性能的控制负载的资源

问题描述:

我目前使用DevEx preSS控制巨资的应用程序。的控制是伟大的,加速开发时间显着(因此,我不想抛弃他们),但是,我有几个问题,他们的表现。

I currently use DevExpress controls heavily in an application. The controls are great and speed-up development time dramatically (and hence, I wouldn't want to ditch them) however, I have a few issues with their performance.

我的应用程序是一个Shell /模块/浏览次数和放大器;的ViewModels应用程序(它遵循了大量的设计模式,你会发现在棱镜)

My application is a Shell/Modules/Views&ViewModels application (it follows a lot of the design patterns you would find in Prism).

在一个视图首次加载它需要一个非常长的时间来显示(在我的一些用户使用的电脑慢的机器,我们正在谈论只是挂在那里至少5秒钟)。它需要明显的时间取决于DX控件的使用(多少的是上有尚未见过由应用程序)。

When a view is first loaded it takes an extremely long time to display (on some of my users PCs with slow machines we're talking 5+ seconds of just hanging there). The time it takes apparently depends on the usage of DX controls (how many ones are on there that haven't been seen before by the application).

当你破坏了看法,并重新打开它,它在不到一秒钟打开。该视图模型在我的测试案例/性能配置文件已重新创建每一次 - 所以在我的code无共享状态视图的调用之间(无单注对象)

When you destroy the view and re-open it, it opens in less than a second. The ViewModel in my test cases/performance profiles has been made to re-create each time - so there is no shared state within my code between invocations of the view (no singleton injected objects).

在一点点的讨论和研究,我似乎已经缩小的问题按需加载的模板文件的DX控制。 有一个线程在这里有关: http://www.devex$p$pss.com/Support/Center/Issues/ViewIssue.aspx?issueid=Q382256 其中提到: http://www.devex$p$pss.com/Support/Center/p/B201967.aspx &放大器; DevEx preSS为WPF加载时间控制 在这些线程所描述的解决方案是显示一个负载指示器,或在启动时就可以使用隐藏窗口的控制。没有这些选项有一些我想要做的(和隐藏的窗口选项似乎没有得到太多的表现,当我试图一个简单的例子,有趣的 - 这也意味着我可能失去了一些东西)

After a bit of discussion and research I appear to have narrowed down the problem to on-demand loading of the template files for the DX controls. There is a thread here about that: http://www.devexpress.com/Support/Center/Issues/ViewIssue.aspx?issueid=Q382256 which references: http://www.devexpress.com/Support/Center/p/B201967.aspx & DevExpress controls for WPF load time The solution described in these threads is to either display a loading indicator or to use a hidden window with controls on it at start-up. Neither of these options are something I'd like to do (and the hidden window option didn't appear to gain much performance when I tried a simple example, interestingly - which also suggests that I might be missing something).

我所希望做的是$ P $,我知道我将需要在后台线程对负载模板文件。有没有什么方法可以让我在WPF做到这一点? (我想这更多的是一种通用的WPF的东西,而不是一个DevEx preSS的东西 - 即使它的东西,必须在DX库本身实现的)。

What I am hoping to do is to pre-load template files that I know I'm going to need on a background thread. Is there any way I can do this in WPF? (I'm thinking this is more a general WPF thing rather than a DevExpress thing - even if it's something that needs to be implemented in the DX libraries themselves).

任何想法,无论是我还是球员在DevEx preSS?

Any ideas for either me or the guys at DevExpress?

什么,你可以在后台线程做的是preLOAD所有必需的组件。另外,还要确保他们nged-ED。 UI控件需要从UI线程初始化

What you can do in the background thread is to preload all the required assemblies. Also make sure they are nged-ed. The UI controls need to be initialized from the UI thread.