欢迎来到在线考试题库网 在线考试题库官网
logo
全部科目 > 微软认证考试 > MCPD > MCPD(70-511)

单项选择题

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' }

点击查看答案

相关考题

微信小程序免费搜题
微信扫一扫,加关注免费搜题

微信扫一扫,加关注免费搜题