PrepAway - Latest Free Exam Questions & Answers

Author: admin

Which XAML fragment should you use?

You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
The application will display a flow document.
You need to add a graphic and its associated descriptive text in the flow document so that the following requirements are met:
* The graphic and the descriptive text appear as a sidebar at the beginning of the document.
* The exact placement of the sidebar is not critical.
* The existing document text flows around the graphic and descriptive text.
* The descriptive text is not truncated.
Which XAML fragment should you use?

Which code fragment should you insert at line 03?

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

01 <Viewport3D>
02 <Viewport3D.Resources>
03
04 <DiffuseMaterial x:Key="Material" Brush="Black" />
05 <GeometryModel3D x:Key="GeometryModel" Geometry="{StaticResource Mesh}" Material="{StaticResource 07 Material}" />
06 </Viewport3D.Resources>
07 <ModelVisual3D Content="{StaticResource GeometryModel}" />
08 </Viewport3D>

You need to display a triangle
Which code fragment should you insert at line 03?

Which code segment should you include in the code-behind file?

You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
You include functionality in the application to troubleshoot the window behavior.
You need to display a list of UI elements at a position in the window that is decided by the mouse click. You also need to ensure that the list of elements is displayed in a message box.
Which code segment should you include in the code-behind file?

Which color should you choose?

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 x:Key="ContentControlStyle">
<Setter Property="ContentControl.Background" Value="Magenta" />
</Style>
</Application.Resources>
You add a window to the application. The window definition includes the following XAML code fragment.

<Window.Style>
<Style>
<Setter Property="Button.Background" Value="Green" />
</Style>
</Window.Style>
<Button Content="Open" Background="Yellow" >
<Button.Style>
<Style>
<Setter Property="Button.Background" Value="Blue" />
</Style>
</Button.Style>
</Button>
You need to identify the background color of the Button control.
Which color should you choose?

Which XAML code fragment should you use?

You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
You add a ListBox control to the user interface of the application. The ListBox control is data bound to a collection of items. Each item contains the Name and the Url properties of the System.String type. The Url property contains a path to an image.
You need to modify the definition of the ListBox control to meet the following requirements:
* Each item must be displayed on a separate line.
* Each line must contain text that displays the Name property of the item to the left of the line.
* The image that corresponds to the item must appear to the right of the text.
Which XAML code fragment should you use?

Which code segment should you use?

You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
You are defining a template as a resource in the application. The template will be applied to a button. You need to ensure that the template definition meets the following requirements:
* An image must appear to the left of the button.
* The content for the button must appear to the right of the button image.
* The template must be restricted only to button controls.
Which code segment 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.

<Rectangle Name="SplineTest">
<Rectangle.RenderTransform>
<TranslateTransform x:Name="SplineTestTrans" X="0" Y="0" />
</Rectangle.RenderTransform>
<Rectangle.Triggers>
<EventTrigger RoutedEvent="Rectangle.MouseLeftButtonDown">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard>

</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
</Rectangle.Triggers>
</Rectangle>

You need to ensure that the Rectangle object shifts diagonally downwards when a user clicks it.
Which XAML code fragment should you use?

Which line of code should you insert at line 09?

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

01 StackPanel stack = new StackPanel();
02 Content = stack;
03 Button btOpen = new Button();
04 btOpen.Content = "Open";
05 Setter setter = new Setter(Button.BackgroundProperty, Brushes.Blue);
06 Style style = new Style();
07 style.Setters.Add(setter);
08 stack.Children.Add(btOpen);
09

You need to ensure that the Button control has a blue background.
Which line of code should you insert at line 09?

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?