Which XAML code fragment should you use?

You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
You create a window by using XAML code. You add a button to the window.
You need to ensure that the font weight of the button changes to bold when either of the following events occur:
* The mouse pointer is moved over the button.
* The button is focused.
Which XAML code fragment should you use?

You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
You create a window by using XAML code. You add a button to the window.
You need to ensure that the font weight of the button changes to bold when either of the following events occur:
* The mouse pointer is moved over the button.
* The button is focused.
Which XAML code fragment should you use?

A.
<Style.Triggers>
<DataTrigger Binding="{Binding Path=IsMouseOver}" Value="True">
<Setter Property="FontWeight" Value="Bold" />
</DataTrigger>
<DataTrigger Binding="{Binding Path=IsFocused}" Value="True">
<Setter Property="FontWeight" Value="Bold" />
</DataTrigger>
</Style.Triggers>

B.
<Style.Triggers>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsMouseOver" Value="True" />
<Condition Property="IsFocused" Value="True" />
</MultiTrigger.Conditions>
<Setter Property="FontWeight" Value="Bold" />
</MultiTrigger>
</Style.Triggers>

C.
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="FontWeight" Value="Bold" />
</Trigger>
<Trigger Property="IsFocused" Value="True">
<Setter Property="FontWeight" Value="Bold" />
</Trigger>
</Style.Triggers>

D.
<Style.Triggers>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding Path=IsMouseOver}" Value="True" />
<Condition Binding="{Binding Path=IsFocused}" Value="True" />
</MultiDataTrigger.Conditions>
<Setter Property="FontWeight" Value="Bold" />
</MultiDataTrigger>
</Style.Triggers>



Leave a Reply 0

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