Spell check textbox in Win10 - Slow

后端 未结 3 1132
长发绾君心
长发绾君心 2020-12-21 01:46

I\'m using the built in spell checker in WPF. It was working just fine until I had users start upgrading to windows 10... I think the issue is that it\'s being used for a

3条回答
  •  死守一世寂寞
    2020-12-21 02:32

    Starting .NET 4.6.1 (in Win8.1 & Win10), WPF uses ISpellChecker interface exposed by the OS to implement its SpellChecker, and the performance characteristics could be somewhat different indeed.

    Notably, ISpellChecker's custom dictionary registrar acts globally - it no longer acts as a per-control registration. (See KB article link below). As a result, registering the same set of dictionaries over and over for each control is wasteful and can potentially degrade your performance. Besides, the OS will just start ignoring your dictionaries when it reaches an internal limit.

    Just register the dictionaries once, or use the alternative registration mechanism outlined at http://blogs.msdn.com/b/wpf/archive/2015/10/29/wpf-in-net-4-6-1.aspx and place the files under %appdata%\microsoft\spelling\.

    If you need to run the same application on Win7/Win8 as well as Win8.1/Win10, you may need to detect the OS and branch your dictionary registration strategy.

    In general, typical uses of custom dictionaries should continue working as usual - with little difference between .NET 4.6.1 vs previous releases.

    Also see https://support.microsoft.com/en-us/kb/3088234 for additional information.

提交回复
热议问题