加速使用WPF的文档自定义的Excel VSTO启动时间

我有一个有点复杂的Excel 2010文档定制。

此自定义还包括自定义任务窗格内的WPF用户控件和一些popup式控件。

问题是我的定制需要大约15秒的时间才能启动。

有没有好的技术来优化这个启动时间?

我的初始化代码如下所示:

// Create a WPF app inside VSTO to configure resource dictionaries and display language _wpfApp = new System.Windows.Application(); // Load the resource dictionary var resources = System.Windows.Application.LoadComponent( new Uri("ModernCashFlow.WpfControls;component/Resources/CustomResources.xaml", UriKind.RelativeOrAbsolute)) as System.Windows.ResourceDictionary; // Merge it on application level _wpfApp.Resources.MergedDictionaries.Add(resources); // Set WPF's app language to system default - useful for number/date formatting - the default is en-US. FrameworkElement.LanguageProperty.OverrideMetadata( typeof(FrameworkElement), new FrameworkPropertyMetadata(XmlLanguage.GetLanguage( CultureInfo.CurrentCulture.IetfLanguageTag))); 

提前致谢。