What should you do to ensure that the following requirements are met?

You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
You write the following XAML code fragment.
(Line numbers are included for reference only.)

01 <DockPanel>
02 <DockPanel.Resources>
03 <Style TargetType="Button">
04 <Style.Triggers>
05
06 </Style.Triggers>
07 </Style>
08 </DockPanel.Resources>
09 <Button Content="Cut">
10 <Button.Triggers>
11
12 </Button.Triggers>
13 </Button>
14 </DockPanel>

You need to ensure that the following requirements are met:
* When the mouse is over the button, the foreground of the button turns yellow.
* When the button is pressed, the foreground of the button turns green.
What should you do?

You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
You write the following XAML code fragment.
(Line numbers are included for reference only.)

01 <DockPanel>
02 <DockPanel.Resources>
03 <Style TargetType=”Button”>
04 <Style.Triggers>
05
06 </Style.Triggers>
07 </Style>
08 </DockPanel.Resources>
09 <Button Content=”Cut”>
10 <Button.Triggers>
11
12 </Button.Triggers>
13 </Button>
14 </DockPanel>

You need to ensure that the following requirements are met:
* When the mouse is over the button, the foreground of the button turns yellow.
* When the button is pressed, the foreground of the button turns green.
What should you do?

A.
Insert the following XAML code fragment at line 11.
<Trigger Property=”Button.IsMouseOver” Value=”True”>
<Setter Property=”Button.Foreground” Value=”Yellow”/>
</Trigger>
<Trigger Property=”Button.IsPressed” Value=”True”>
<Setter Property=”Button.Foreground” Value=”Green”/>
</Trigger>

B.
Insert the following XAML code fragment at line 11.
<Trigger Property=”Button.IsPressed” Value=”True”>
<Setter Property=”Button.Foreground” Value=”Green”/>
</Trigger>
<Trigger Property=”Button.IsMouseOver” Value=”True”>
<Setter Property=”Button.Foreground” Value=”Yellow”/>
</Trigger>

C.
Insert the following XAML code fragment at line 05.
<Trigger Property=”IsMouseOver” Value=”True”>
<Setter Property=”Foreground” Value=”Yellow”/>
</Trigger>
<Trigger Property=”IsPressed” Value=”True”>
<Setter Property=”Foreground” Value=”Green”/>
</Trigger>

D.
Insert the following XAML code fragment at line 05.
<Trigger Property=”IsPressed” Value=”True”>
<Setter Property=”Foreground” Value=”Green”/>
</Trigger>
<Trigger Property=”IsMouseOver” Value=”True”>
<Setter Property=”Foreground” Value=”Yellow”/>
</Trigger>



Leave a Reply 0

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