PrepAway - Latest Free Exam Questions & Answers

Category: 70-502

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

Which code segment 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 object content;
02 string fileName = "theFile";
03 using (FileStream xamlFile = new FileStream(fileName + ".xaml", FileMode.Open, FileAccess.Read))
04 {
05 content = (object)XamlReader.Load(xamlFile);
06 }
07 using (Package container = Package.Open(fileName + ".xps", FileMode.Create))
08 {
09
10 }

You need to ensure that the following requirements are met:
* The application converts an existing flow document into an XPS document.
* The XPS document is generated by using the flow document format.
* The XPS document has the minimum possible size.
Which code segment should you insert at line 09?

Which configuration setting should you use?

You have created a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
The application, named EnterpriseApplication.exe, runs over the network.
You add the WindowSize parameter and the WindowPosition parameter to the Settings.settings file by using the designer at the User Scope Level.
The dimensions and position of the window are read from the user configuration file.
The application must retain the original window size and position for users executing the application.
You need to ensure that the following requirements are met:
* The window dimensions for each user are saved in the user configuration file.
* User settings persist when a user exits the application.
Which configuration setting 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 plan to add a Button control and a StatusBar control to a window.
You need to ensure that the two controls meet the following requirements:
* The StatusBar control sticks to the lower edge of the window.
* The Button control has the minimum required size to display its content.
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.
You plan to implement a search functionality for a text editor. You write the following code segment for the WPF screen.

<DockPanel>
<WrapPanel DockPanel.Dock="Top">
<TextBox Name="tbxTextToFind" Width="200" />
<Button Name="btnFind" Width="80" Click="btnFind_Click">Find</Button>
</WrapPanel>
<RichTextBox Name="rtbText" />
</DockPanel>

You need to ensure that on clicking the Find button, the value of the tbxTextToFind text box is selected in the rtbText control.
Which code segment should you use?

Which two actions should you perform?

You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
You create a dialog window composed of a TextBox control and a Button control by using the following XAML code fragment.

<TextBox Width="200" AcceptsReturn="True" />
<Button Width="80" Click="Button_Click">OK</Button>

You need to ensure that each time the user presses the ENTER key, the click event of the OK button is raised.
Which two actions should you perform? (Each correct answer presents part of the solution.)

Which control should you use?

You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
You create a window in the application. You plan to select a layout control to host the elements that you add to the window.
You need to select a control that meets the following requirements with its default properties:
1. The elements stretch horizontally to occupy the available width of the window.
2. The elements do not stretch vertically.
Which control should you use?

Which code segment should you insert at line 05?

You are converting a Windows Forms application to a Windows Presentation Foundation (WPF) application. You use Microsoft .NET Framework 3.5 to create the WPF application.
The WPF application will reuse 30 forms of the Windows Forms application. The WPF application contains the following class definition.

public class OwnerWindow : System.Windows.Forms.IWin32Window
{
private IntPtr handle_Renamed;
public IntPtr Handle
{
get { return handle_Renamed ; }
set { handle_Renamed = value ; }
}
}

You write the following code segment in the WPF application.
(Line numbers are included for reference only.)

01 public System.Windows.Forms.DialogResult LaunchWindowsFormsDialog(System.Windows.Forms.Form dialog, Window wpfParent)
02 {
03 System.Windows.Interop.WindowInteropHelper helper = new System.Windows.Interop.WindowInteropHelper(wpfParent) ;
04 OwnerWindow owner = new OwnerWindow() ;
05
06 }

You need to ensure that the application can launch the reusable forms as modal dialogs.
Which code segment should you insert at line 05?


Page 8 of 9« First...56789