单项选择题
You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application.
You add a ListBox control to the application. The ListBox control is data-bound to an instance of a custom collection class of the Product objects named ProductList.
The number of items of the data-bound collection is fixed. However, users can modify the properties of each of the Product objects in the collection.
You need to ensure that changes made on the Product objects are automatically reflected in the ListBox control.
What should you do?()
A. Implement the INotifyPropertyChanged interface in the Product class.
B. Implement the INotifyCollectionChanged interface in the ProductList class.
C. Set the Mode property of the Binding object of the ListBox control to TwoWay.
D. Set the UpdateSourceTrigger property of the Binding object of the ListBox control to PropertyChanged.
相关考题
-
单项选择题
You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. You write the following code fragment. You need to implement the MyProject.AverageConverter class. What should you do?()
A. Implement the IValueConverter interface.
B. Implement the IMultiValueConverter interface.
C. Inherit from the TypeConverter class.
D. Apply the TypeConverterAttribute attribute. -
单项选择题
You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. You write the following code fragment. You need to implement the MyProject.MyConverter class. What should you do?()
A. Implement the IValueConverter interface.
B. Implement the IMultiValueConverter interface.
C. Inherit from the TypeConverter class.
D. Apply the TypeConverterAttribute attribute. -
单项选择题
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. You need to ensure that the StringMember property of the data-bound object is updated immediately when the user types the TextBox control. Which binding expression should you use?()
A. { Binding Path=StringMember, Mode=TwoWay }
B. { Binding Path=StringMember, NotifyOnSourceUpdated=True }
C. { Binding Path=StringMember, NotifyOnTargetUpdated=True }
D. { Binding Path=StringMember, UpdateSourceTrigger=PropertyChanged }
