Microsoft
70-511 · Question #153
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. You write the following code fragment. < TextBox Text="{Binding…
The correct answer is D. {Binding Path=StringMember, UpdateSourceTrigger=PropertyChanged}. See the full explanation below for the reasoning.
Question
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. You write the following code fragment. < TextBox Text="{Binding Path=StringMember} " / > You need to ensure that the StringMember property of the data-bound object is updated immediately when the user types in the TextBox control. Which binding expression should you use?
Options
- A{Binding Path=StringMember, Mode=Two way}
- B{Binding Path=StringMember, NotifyOnSourceUpdated=True}
- C{Binding Path=StringMember, NotifyOnTargetUpdated=True}
- D{Binding Path=StringMember, UpdateSourceTrigger=PropertyChanged}
How the community answered
(53 responses)- A4% (2)
- B6% (3)
- C13% (7)
- D77% (41)
Community Discussion
No community discussion yet for this question.