What are two possible code fragments you can use to achieve this goal?
You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
You use the following code fragment.
<RadioButton>Option 1</RadioButton>
<RadioButton>Option 2</RadioButton>
<RadioButton>Option 3</RadioButton>
<RadioButton>Option A</RadioButton>
<RadioButton>Option B</RadioButton>
<RadioButton>Option C</RadioButton>
You need to ensure that the following requirements are met:
* Options 1, 2, and 3 are mutually exclusive options.
* Options A, B, and C are mutually exclusive options.
* Keyboard shortcuts are available for each option.
What are two possible code fragments you can use to achieve this goal? (Each correct answer presents a complete solution. Choose two.)
Which XAML code fragment should you use?
You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
You plan to define three columns for a Grid control.
You need to ensure that the column definition meets the following requirements:
* The central column is twice as wide as the side columns.
* The columns occupy all the available horizontal space.
Which XAML code fragment should you use?
Which XAML code fragment should you use?
You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
You write the following XAML code fragment.
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Button Grid.Column="0">Left</Button>
<Button Grid.Column="2">Right</Button>
</Grid>
You need to perform the following tasks:
* Ensure that the columns that hold the Button controls can be resized by dragging a line between them.
* Ensure that only a space of 5 device-independent pixels remains between the two Button controls.
Which XAML code fragment should you use?
Which code segment should you use?
You are creating a Windows Presentation Foundation (WPF) application by using Microsoft .NET Framework 3.5.
The WPF application has a Grid control named rootGrid.
You write the following XAML code fragment.
<Window x:Class="MCP.HostingWinFormsControls" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/ presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="HostingWinFormsControls" Loaded="Window_Loaded">
<Grid x:Name="rootGrid">
</Grid>
</Window>
You need to ensure that each time the WPF window opens, a Windows Forms control named MyCustomFormsControl is added to rootGrid.
Which code segment should you use?
Which code fragment should you use?
You create a form by using Windows Presentation Foundation. You use Microsoft .NET Framework 3.5 to create the form.
You add a ContextMenu control to the text box named myText on the form. You add the following menu items to the control:
* Copy
* Paste
You need to ensure that the following requirements are met:
* You can copy and paste text.
* The ContextMenu items have input text gestures.
* You can copy and paste text by either clicking the menu items or by using keyboard shortcuts.
You want to achieve this goal by using the least possible code.
Which code fragment should you use?
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 that has an arbitrary size. You plan to add two Button controls to the window. You need to ensure that each Button control fills exactly half the window space.
Which XAML code fragment should you use?
Which two actions should you perform?
You are creating a localized version of a Windows Presentation Foundation application.
The application is deployed to all users in an English-only version. The English-only version was created by using the following process:
The <UICulture>en-US</UICulture> elements were added to the application project files.
The elements that required localization were marked with the x:Uid attributes in XAML code.
You need to use minimum possible effort to create a localized version of the application without impacting the English-only version.
Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)
Which XAML code fragment should you insert at line 03?
You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
The application-definition file contains the following XAML code fragment.
<Application.Resources>
<Style TargetType="Button" x:Key="buttons">
<Setter Property="Margin" Value="5" />
<Setter Property="Background" Value="Olive" />
</Style>
</Application.Resources>
You add a window to the application. The window includes the following XAML code fragment.
(Line numbers are included for reference only.)
01 <StackPanel>
02 <StackPanel.Resources>
03
04 <Setter Property="Button.Background" Value="Blue" />
05 </Style>
06 </StackPanel.Resources>
07 <Button Content="Open" />
08 </StackPanel>
You need to ensure that the Button control of the window meets the following requirements:
* The Margin property is set to 5.
* The Background property is set to Blue.
Which XAML code fragment should you insert at line 03?
Which XAML code fragment should you insert at line 10?
You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
You write the following XAML code fragment.
01 <StackPanel.Resources>
02 <ControlTemplate x:Key="buttonTemplate" TargetType="{x:Type Button}">
03 <Grid>
04 <Rectangle x:Name="buttonBackground" Width="100" Height="30" Fill="Blue" />
05 <WrapPanel>
06 <Image x:Name="buttonImage" Width="20" Height="20" Source="buttonImage.jpg" />
07 <ContentPresenter Margin="10" />
08 </WrapPanel>
09 </Grid>
10
11 </ControlTemplate>
14 </StackPanel.Resources>
You plan to apply the buttonTemplate template to 20 buttons. You need to ensure that a sound file named soundFile.wav is played when the user moves the
mouse pointer over the image on any of the 20 buttons.
Which XAML code fragment should you insert at line 10?
Which code segment should you use?
You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
You use a template for button controls. The template is defined as a resource on the page that contains the button controls. The template has a key named tpCancel. You plan to add a button named Cancel to the user interface of the application. You need to ensure that the Cancel button uses the template.
Which code segment should you use?