Reputation:
I use in WPF textBox control as chat window -> use typing chat messages into textBox control. Problem is that user typing little faster TextBox reacts slowly. I would like to somehow accelerated response of textBox if it possible.
Any idead. It is difficult describe this behevior, if you have some time try it, quickly type in this control.
Edited:
Here is original part of textBox’s code:
<TextBox Text="{Binding Path=RpText,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
TextWrapping="Wrap"
VerticalScrollBarVisibility="Auto"
FontSize="14"
Margin="2,2,2,2"
Grid.Row="3"
MinHeight="70"
Micro:Message.Attach="[PreviewKeyDown]=[Action SendRp($eventArgs)]"/>
I omitted the two way binding and also PreviewKeyDown and I would say it is the same by my opinion.
Here is modified code of textBox’s
<TextBox
TextWrapping="Wrap"
VerticalScrollBarVisibility="Auto"
FontSize="14"
Margin="2,2,2,2"
Grid.Row="3"
MinHeight="70"/>
But I compare reacts with typing in skype, gtalk and I think it was stupid compare MS WPF control with "textBox control" in Skype or gtalk.
About Asyc binding I try it:
<TextBox Text="{Binding Path=RpText,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, IsAsync=True}"/>
Text is writing in textbox control as reverse.
For example you typing: Hello and in textBox constrol is olleH :)
Upvotes: 2
Views: 604
Reputation: 17272
Bindings and event handlers can slow down text box. Do you have any complex code bound to the Text property? Do you have any event handlers that could slow down the text box?
You can use asynchronous bindings, if you can't afford reducing the complexity of the bound property's code. If you process the text box's text via event, do the bulk of the operations in a separate thread (so the GUI thread is not slowed down).
Upvotes: 2