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:AverageConverter x:Key=”avgConverter” />
</Window.Resources>
<StackPanel Orientation=”Vertical”>
<Slider x:Name=”sld01″ Minimum=”0″ Maximum=”100″ />
<Slider x:Name=”sld02″ Minimum=”0″ Maximum=”50″ />
<Slider x:Name=”sld03″ Minimum=”0″ Maximum=”50″ />
<TextBlock> <TextBlock.Text>
<MultiBinding Converter=”{StaticResource avgConverter}”>
<Binding ElementName=”sld01″ Path=”Value” />
<Binding ElementName=”sld02″ Path=”Value” />
<Binding ElementName=”sld03″ Path=”Value” />
</MultiBinding> </TextBlock.Text>
</TextBlock>
</StackPanel>
</Window>
You need to implement the MyProject.AverageConverter class.
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:AverageConverter x:Key=”avgConverter” />
</Window.Resources>
<StackPanel Orientation=”Vertical”>
<Slider x:Name=”sld01″ Minimum=”0″ Maximum=”100″ />
<Slider x:Name=”sld02″ Minimum=”0″ Maximum=”50″ />
<Slider x:Name=”sld03″ Minimum=”0″ Maximum=”50″ />
<TextBlock> <TextBlock.Text>
<MultiBinding Converter=”{StaticResource avgConverter}”>
<Binding ElementName=”sld01″ Path=”Value” />
<Binding ElementName=”sld02″ Path=”Value” />
<Binding ElementName=”sld03″ Path=”Value” />
</MultiBinding> </TextBlock.Text>
</TextBlock>
</StackPanel>
</Window>
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.



Leave a Reply 0

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