Domanda

I have a wpf 4.5 application where I am trying to trouble shoot why my controls are slow, or have lag with the user input. If a user tabs between control, like textboxes, or changes the text of a textbox there is a serious lag between the user typing and the text appearing in the text box.

For example: A textbox declaration

<TextBox x:Name="chrTitle" 
         Style="{StaticResource FTC_ValidateTextBox}" 
         Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="1"
         Text="{Binding chrTitle, Mode=TwoWay, ValidatesOnDataErrors=True, UpdateSourceTrigger=PropertyChanged}" />

I thought it might be the validation so: I have tried removing the ValidatesOnDataErrors and changing the UpdateSourceTrigger to lostfocus, property changed and explicit. With no improvement.

I thought it might be a style or binding related issue so: I also set the style to x:Null and I removed the binding al together, both also gave no improvement.

This affects other controls like drop downs.

Question:

Can someone help me trouble shoot what in my application is causing input lag with controls like textboxes and dropdowns.

È stato utile?

Soluzione

In my experience with slow WPF applications, common causes can be:

  1. broken bindings,

  2. unstopped storyboards

  3. inefficient command CanExecute functions

This would be the first place to start

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top