Is there anyway that I can improve (wpf) richtextbox performance?
I am writing a text editor and right now if I type very quickly or hold down a key the typing gets very laggy. I was previously working on a winforms version of this program and there was n开发者_Python百科o lag. Would it be possible for me to create a custom richtextbox control and strip out all of the unneeded properties? What would be the best way to fix my problem?
Check out the AvalonEdit open source syntax-highlighting text editor that is used in SharpDevelop. It may give you some ideas. I would also look towards .NET 4 which has been worked over big time in order to achieve big performance gains needed by Visual Studio (which uses WPF for nearly the entire shell.)
In particular, in .NET 3.5, controls did a lot of unnecessary repainting. Check out this blog post about WPF performance tips.
精彩评论