I have two textboxes which binds to the same property. One textbox is for the original text, the second is for the new text. What I’m having issue is, when the first textbox’s text gets submitted, it returns the original text. But when I type in the second textbox to update the name, this automatically override what’s in the first textbox’s text. I was just wondering if there’s anyway of stopping this so I’ll have original and new text displaying.
<TextBox Name="txtOriginalName"
HorizontalAlignment="Right" VerticalAlignment="Top"
Width="524" Height="auto" TextWrapping="Wrap"
AcceptsReturn="True" HorizontalScrollBarVisibility="Auto"
Text="{Binding Path=Person.Name}"/>
<TextBox Name="txtNewName"
HorizontalAlignment="Right" VerticalAlignment="Top"
Width="524" Height="auto" TextWrapping="Wrap" AcceptsReturn="True"
HorizontalScrollBarVisibility="Auto"
Text="{Binding Path=Person.Name}"/>
Try
Text="{Binding Path=Person.Name, Mode=OneTime}"for txtOriginalName, then txtOriginalName will be initialised to the value in Person.Name, but won’t be updated when Person.Name changes later.Here’s a useful binding cheat sheet