多做题,通过考试没问题!

微软认证考试

睦霖题库>其他计算机考试>微软认证考试

You use Microsoft Visual Studio 2010 and Microsoft . NET Framework 4 to create a Windows Presentation Foundation (WPF) application. You create a WPF window in the application. You add the following code segment to the application. public class ViewModel { public CollectionView Data { get; set; } } public class BusinessObject { public string Name { get; set; } } The DataContext property of the window is set to an instance of the ViewModel class. The Data property of the ViewModel instance is initialized with a collection of BusinessObject objects. You add a TextBox control to the Window. You need to bind the Text property of the TextBox control to the Name property of the current item of the CollectionView of the DataContext object. You also need to ensure that when a binding error occurs, the Text property of the TextBox control is set to N/A . Which binding expression should you use?()

  • A、 { Binding Path=Data/Name, FallbackValue='N/A' }
  • B、 { Binding Path=Data.Name, FallbackValue='N/A' }
  • C、 { Binding Path=Data/Name, TargetNullValue='N/A' } 
  • D、 { Binding Path=Data.Name, TargetNullValue='N/A' }
正确答案:A
答案解析:
进入题库查看解析

微信扫一扫手机做题