Microsoft Exam Questions

What should you do?

You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application.
You write the following code fragment.
<Window x:Class=”MyProject.MainWindow” xmlns:local=”clr-namespace:MyProject”>
<Window.Resources>
<local:MyConverter x:Key=”myConverter” />
</Window.Resources>
<ListBox Name=”box”>
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text=”{Binding Converter={StaticResource myConverter}, ConverterParameter=formatText}”
Background=”{Binding Converter={StaticResource myConverter},
ConverterParameter=formatColor}” IsEnabled=”{Binding Converter={StaticResource myConverter}}” />
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox> </Window>
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.