1

我有一个有些复杂的 Excel 2010 文档自定义。

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

问题是我的自定义需要大约 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)));

提前致谢。

4

0 回答 0