Which XAML code fragment should you use?

You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
You add textbox controls to the user interface of the application.
You need to set the format for each textbox control in the following manner:
* The font is Segoe UI.
* The font size is 16.
Which XAML code fragment should you use?

You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
You add textbox controls to the user interface of the application.
You need to set the format for each textbox control in the following manner:
* The font is Segoe UI.
* The font size is 16.
Which XAML code fragment should you use?

A.
<Style x:Key="MyTextBoxStyle">
<Setter Property="TextBox.FontSize" Value="16" />
<Setter Property="TextBox.FontFamily" Value="Segoe UI" />
</Style>…
<TextBox Style="{DynamicResource MyTextBoxStyle}">

</TextBox>

B.
<Style BasedOn="MyTextBoxStyle" x:Key="TextBox">
<Setter Property="TextBox.FontSize" Value="16" />
<Setter Property="TextBox.FontFamily" Value="Segoe UI" />
</Style>
<TextBox FontStyle="{DynamicResource MyTextBoxStyle}">

</TextBox>

C.
<Style x:Name="MyTextBoxStyle" x:Key="TextBox">
<Setter Property="TextBox.FontSize" Value="16" />
<Setter Property="TextBox.FontFamily" Value="Segoe UI" />
</Style>…
<TextBox Style="{DynamicResource MyTextBoxStyle}">

</TextBox>

D.
<Style x:Name="MyTextBoxStyle" x:Key="TextBox">
<Setter Property="TextBox.FontSize" Value="16" />
<Setter Property="TextBox.FontFamily" Value="Segoe UI" />
</Style>…
<TextBox FontStyle="{DynamicResource MyTextBoxStyle}">

</TextBox>



Leave a Reply 0

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