Which code segment should you insert at line 03?

You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
You create an XAML page named Inventory Management for the application.
You add a bound TextBox control named txtSetInventoryLevel to the page. The TextBox control is set to explicitly update the data source.
You add the following method to update the inventory level.

01 private void UpdateInventoryLevel(int quantity)
02 {
03 …
04 }

You need to ensure that the changes made in the txtSetInventoryLevel TextBox control are reflected in the data source.
Which code segment should you insert at line 03?

You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
You create an XAML page named Inventory Management for the application.
You add a bound TextBox control named txtSetInventoryLevel to the page. The TextBox control is set to explicitly update the data source.
You add the following method to update the inventory level.

01 private void UpdateInventoryLevel(int quantity)
02 {
03 …
04 }

You need to ensure that the changes made in the txtSetInventoryLevel TextBox control are reflected in the data source.
Which code segment should you insert at line 03?

A.
Binding binding = BindingOperations.GetBinding(txtSetInventoryLevel, TextBox.TextProperty)
binding.Mode = BindingMode.OneTime

B.
Binding binding = BindingOperations.GetBinding(txtSetInventoryLevel, TextBox.TextProperty)
binding.Mode = BindingMode.OneWayToSource

C.
BindingExpression binding = txtSetInventoryLevel.GetBindingExpression(TextBox.TextProperty)
binding.UpdateSource()

D.
BindingExpression binding = txtSetInventoryLevel.GetBindingExpression(TextBox.TextProperty)
binding.UpdateTarget()



Leave a Reply 0

Your email address will not be published. Required fields are marked *