Which code fragment should you insert at line 06?

You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application.
You write the following code fragment. (Line numbers are included for reference only.)
01<StackPanel>
02<StackPanel.Resources>
03<ControlTemplate
04TargetType=”{x:Type Button}”
05x:Key=”btn”>
06 07</ControlTemplate>
08</StackPanel.Resources>
09<Button Content=”Save” 10Template=”{StaticResource btn}” />
11<Button Template=”{StaticResource btn}”>
12<TextBox Text=”Save” />
13</Button>
14</StackPanel>
You need to ensure that both Button controls display the “Save” text.
Which code fragment should you insert at line 06?

You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application.
You write the following code fragment. (Line numbers are included for reference only.)
01<StackPanel>
02<StackPanel.Resources>
03<ControlTemplate
04TargetType=”{x:Type Button}”
05x:Key=”btn”>
06 07</ControlTemplate>
08</StackPanel.Resources>
09<Button Content=”Save” 10Template=”{StaticResource btn}” />
11<Button Template=”{StaticResource btn}”>
12<TextBox Text=”Save” />
13</Button>
14</StackPanel>
You need to ensure that both Button controls display the “Save” text.
Which code fragment should you insert at line 06?

A.
<TextBlock Text=”{Binding}” />

B.
<TextBlock Text=”{TemplateBinding Content}” />

C.
<ContentPresenter Content=”{Binding}” />

D.
<ContentPresenter />



Leave a Reply 0

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