WPF Performance Issues with TextBox Controls Installed

I have a WPF application that displays input forms based on form configurations stored in a database.

Forms have many controls (100+), and most of these controls are derived from the TextBox control. On some machines (fast hardware, Win7 32Bit, as well as some older ones, Windows XP 32Bit), after entering data into many of these forms, input performance decreases. Each keystroke receives a delay of several milliseconds, and the only solution to eliminate it is to close the application and restart it.

My derived control overrides the DefaultStyleKeyProperty metadata to set a custom template.

I am currently browsing the application in the SciTech memory profiler, but maybe someone has already encountered a similar problem with derived text fields and can give me a hint and save me some hours / days researching the problem?

Update
See also here

+1
source share
2 answers

It looks like you might have something stopping the controls on the β€œforms used” that are GCed.

First, open and use as many forms as possible by looking at the Windows task manager to see if memory usage is increasing - if it’s not, it makes no sense to look for memory cover

Make sure that you delete all the event handlers that you form / the controls that are imposed on any long-lived objects.

Make sure that any objects that you attach to implement INotifyPropertyChanged see KB938416

I have had good results in the past using the Red Gate Memory Profiler .

+1
source

You do not need to create controls that the user does not see, more than 100 controls will be worth it.

Can you use something in the list control list in virtual mode, so your TextBox controls are only created when they are visible.

0
source

All Articles