PrepAway - Latest Free Exam Questions & Answers

Category: 70-502

Exam 70-502: TS: Microsoft .NET Framework 3.5, Windows Presentation Foundation Application Development

Which two actions should you perform?

You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
You plan to use the application to preview video files. You write the following XAML code fragment.

01 <Window x:Class="myClass" xmlns= "http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="myWindow" Height="300" Width="300">
02 <StackPanel Background="Black">
03
04 <StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
05 <Button Name="btnPlay" Margin="10" Content="Play" />
06 </StackPanel>
07
08 </StackPanel>
09 </Window>

You need to ensure that the application plays only the first 10 seconds of a video that you want to preview.
Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

Which code segment should you insert at line 08?

You are creating a Windows Presentation Foundation (WPF) application by using Microsoft .NET Framework 3.5.
The application contains a window that programatically displays an image. The window contains a Grid control named theGrid. You write the following code segment.
(Line numbers are included for reference only.)

01 Image theImage = new Image();
02 theImage.Width = 200;
03 BitmapImage theBitmapImage = new BitmapImage();
04 theBitmapImage.BeginInit();
05 theBitmapImage.UriSource = new Uri("imageToDisplay.jpg");
06 theBitmapImage.DecodePixelWidth = 200;
07 theBitmapImage.EndInit();
08
09 theGrid.Children.Add(theImage);

You need to crop an elliptical region of the image such that the ellipse is centered at the location X=75 and Y=50.
Which code segment should you insert at line 08?

Which code segment should you insert at line 04?

You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
The application has a window that programatically displays an image. The window contains a grid named theGrid. The window displays images in their actual size. You want the images to be 200 pixels wide. You write the following code segment.

01 Image theImage = new Image();
02 theImage.Width = 200;
03 BitmapImage theBitmapImage = new BitmapImage();
04
05 theImage.Source = theBitmapImage;
06 theGrid.Children.Add(theImage);

You need to ensure that the application meets the following requirements:

* The window uses the least amount of memory to display the image.
* The image is not skewed.

Which code segment should you insert at line 04?

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?


Page 3 of 912345...Last »