MCTS Microsoft

Microsoft 70-502 Demo,100% Real Microsoft 70-502 PDF Download Will Be More Popular

100% valid Microsoft 70-502 Flydumps with more new added questions.By training the Microsoft 70-502 questions, you will save a lot time in preparing the exam.Visit www.Flydumps.com to get the 100% pass Microsoft 70-502 ensure!

Question: 1
You create a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5. The application tracks stock prices in real time. You need to bind a label to the Price property of the Stock class. You also need to ensure that the label reflects any change in the Price property. Which code segment should you use?
A. public class Stock: DependencyObject { private decimal _price; public decimal Price { get {
return
_price; } set { _price = value; ) }}

B. public class Stock: DependencyObject { public static readonly DependencyProperty
PriceProperty =
DependencyProperty.Register(“Price”, typeof(decimal), typeof(Stock)); public decimal Price { get {
return
(decimal)GetValue(PriceProperty); } set { SetValue(PriceProperty, value); } }}

C. public class Stock { public event EventHandler PropertyChanged; private decimal _price; public
decimal
Price { get { return _price; } set { _price = value; if (PropertyChanged != null)
PropertyChanged(this, EventArgs.Empty); } }}

D. public class Stock { public event PropertyChangedEventHandler PropertyChanged; private
decimal
_price; public decimal Price { get { return _price; } set { _price = value; if (PropertyChanged !=
null)
PropertyChanged(this, new PropertyChangedEventArgs(“Price”)); } }}

Answer: B
Question: 2
You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5. You implement validation for a data bound text box control. When a user enters an invalid value in the text box, the border of the text box turns red. You need to update the application so that both the border and the text of the text box control turn red when an invalid value is entered. What should you do?
A. Use a custom control template.
B. Create a custom validation rule.
C. Add an exception handler to the code-behind file.
D. Add two validation rules to the ValidationRules element.
Answer: A
You are creating a Windows Presentation Foundation application by using Microsoft .NET
Framework 3.5.
You create a window for the application. You add an image to the window.
You need to ensure that the following requirements are met:
The image is scaled to completely fit the client area of the window.
The image aspect ratio is preserved.
The entire image is displayed within the window.
Which code fragment should you use?

A. <Image Source=”imageToDisplay.jpg” Stretch=”None” />
B. <Image Source=”imageToDisplay.jpg” Stretch=”Fill” />
C. <Image Source=”imageToDisplay.jpg” Stretch=”Uniform” />
D. <Image Source=”imageToDisplay.jpg” Stretch=”UniformToFill” />

Answer: C
Question: 4
You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5. Your project contains a folder named Data. You add an MP3 file named song.mp3 in the Data folder. You set the Build Action property of the MP3 file to Resource. You need to access the MP3 file from the application. Which code segment should you use?
A. Uri uri = new Uri(“/Data/song.mp3”, UriKind.Relative);StreamResourceInfo sri=Application.GetContentStream(uri);Stream stream=sri.Stream;
B. Uri uri = new Uri(“/Data/song.mp3”, UriKind.Relative);StreamResourceInfo sri=Application.LoadComponent(uri);Stream stream=sri.Stream;
C. Uri uri = new Uri(“/Data/song.mp3”, UriKind.Relative);StreamResourceInfo sri=Application.GetRemoteStream(uri);Stream stream=sri.Stream;
D. Uri uri = new Uri(“/Data/song.mp3”, UriKind.Relative);StreamResourceInfo sri=Application.GetResourceStream(uri);Stream stream=sri.Stream;

Answer: D
You are creating a Windows Presentation Foundation application by using Microsoft .NET
Framework 3.5.
The application displays an image that is defined as an application resource.
You need to ensure that the following requirements are met:
The image file must appear in the output directory after the build.
The image can be modified without being rebuilt.
What should you do?

A. Include the image in your project. Set the Build Action property for the file to Resource. Set the Copy to Output Directory property to Copy if newer.
B. Include the image in your project. Set the Build Action property for the file to Content. Set the Copy to Output Directory property to Copy if newer.
C. Include the image in your project. Set the Build Action property for the file to Embedded Resource. Set the Copy to Output Directory property to Copy always.
D. Include the image in your project. Set the Build Action property for the file to ApplicationDefinition. Set the Copy to Output Directory property to Copy if newer.

Answer: B
Question: 6
You are creating a Windows Presentation Foundation application by using Microsoft .NET
Framework 3.5. The application will display articles that contain photographs, geometric figures, and
other rich content. You plan to format the articles in flow documents. You need to select a XAML
element that provides the following functionality by default:
Searches the content of any article.
Views any article in single-page and multiple-page layouts.
Adjusts the font size of the content.
What should you do?

A. Encapsulate the articles in a <RichTextBox></RichTextBox> XAML element.
B. Encapsulate the articles in a <FlowDocumentReader></FlowDocumentReader> XAML element.
C. Encapsulate the articles in a <FlowDocumentPageViewer></FlowDocumentPageViewer> XAML element.
D. Encapsulate the articles in a <FlowDocumentScrollViewer></FlowDocumentScrollViewer> XAML element.

Answer: B
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 Dim content As Object
02 Dim fileName As String = “theFile”
03 Using xamlFile As New FileStream(fileName & “.xaml”, _
04 FileMode.Open, FileAccess.Read)
06 content = TryCast(XamlReader.Load(xamlFile), Object)
07 End Using
08 Using container As Package = Package.Open(fileName & “.xps”, _
09 FileMode.Create
11 End Using
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 10?

A. Using xpsDoc As New XpsDocument(container, _ CompressionOption.SuperFast) Dim rsm As XpsSerializationManager = New _ System.Windows.Xps.XpsSerializationManager(New _ XpsPackagingPolicy(xpsDoc), False) rsm.SaveAsXaml(paginator) End Using
B. Using xpsDoc As New XpsDocument(container, _ CompressionOption.SuperFast) Dim rsm As New XpsSerializationManager(New _ XpsPackagingPolicy(xpsDoc), False) rsm.Commit() End Using
C. Using xpsDoc As New XpsDocument(container, _ CompressionOption.Maximum) Dim rsm As New XpsSerializationManager(New _ XpsPackagingPolicy(xpsDoc), False) Dim paginator As DocumentPaginator = (CType(content, _ IDocumentPaginatorSource)).DocumentPaginator rsm.SaveAsXaml(paginator) End Using
D. Using xpsDoc As New XpsDocument(container, _ CompressionOption.SuperFast) Dim rsm As New XpsSerializationManager(New _ XpsPackagingPolicy(xpsDoc), False) Dim paginator As DocumentPaginator = (CType(content, _ IDocumentPaginatorSource)).DocumentPaginator rsm.SaveAsXaml(paginator) End Using
Answer: C
You are creating a Windows Presentation Foundation application by using Microsoft .NET
Framework 3.5.
You add a window that displays three-dimensional graphics.
You need to create a camera that meets the following requirements:
It displays a graphic by excluding the Z-dimension.
It focuses directly on the front portion of the graphic.
Which XAML code fragment should you use?

A. <OrthographicCamera Position=”0,0,2″ LookDirection=”0,2,-1″ />
B. <OrthographicCamera Position=”0,0,2″ LookDirection=”0,0,-1″ />
C. <PerspectiveCamera Position=”0,0,2″ LookDirection=”0,2,-1″ FieldOfView=”60″ />
D. <PerspectiveCamera Position=”0,0,2″ LookDirection=”0,0,-1″ FieldOfView=”60″ />

Answer: B
Question: 9
You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5. The application displays documents by using an instance of the FlowDocumentPageViewer class. The instance is named fdpv. Users can highlight and annotate the content of the documents. You need to ensure that annotations made to a document are saved and rendered when the document is displayed again. Which code segment should you use?
A. protected void OnTextInput(object sender, RoutedEventArgs e) { AnnotationService service = AnnotationService.GetService(fdpv); if (service == null) { AnnotationStream = new FileStream(“annotations.xml”, FileMode.Open, FileAccess.ReadWrite); service = new AnnotationService(fdpv); AnnotationStore store = new XmlStreamStore(AnnotationStream); service.Enable(store); }}private void OnClosing(object sender, System.ComponentModel.CancelEventArgs e) { AnnotationService service = AnnotationService.GetService(fdpv); if (service != null && service.IsEnabled) { service.Store.Flush(); service.Disable(); AnnotationStream.Close(); }}
B. protected void OnLoaded(object sender, RoutedEventArgs e) { AnnotationService service = AnnotationService.GetService(fdpv); if (service == null) { AnnotationStream = new FileStream(“annotations.xml”, FileMode.Open, FileAccess.ReadWrite); service = new AnnotationService(fdpv); }}private void OnClosing(object sender, System.ComponentModel.CancelEventArgs e) { AnnotationService service = AnnotationService.GetService(fdpv); if (service != null && service.IsEnabled) { service.Store.Flush(); service.Disable(); AnnotationStream.Close(); }}
C. protected void OnLoaded(object sender, RoutedEventArgs e) { AnnotationService service = AnnotationService.GetService(fdpv); if (service == null) { AnnotationStream = new FileStream(“annotations.xml”, FileMode.Open, FileAccess.ReadWrite); service = new AnnotationService(fdpv); AnnotationStore store = new XmlStreamStore(AnnotationStream); service.Enable(store); }}private void OnClosing(object sender, System.ComponentModel.CancelEventArgs e) { AnnotationService service = AnnotationService.GetService(fdpv); if (service != null && service.IsEnabled) { service.Store.Flush(); service.Disable(); AnnotationStream.Close(); }}
D. protected void OnLoaded(object sender, RoutedEventArgs e) { AnnotationService service = AnnotationService.GetService(fdpv); if (service == null) { AnnotationStream = new FileStream(“annotations.xml”, FileMode.Open, FileAccess.ReadWrite); service = new AnnotationService(fdpv); AnnotationStore store = new XmlStreamStore(AnnotationStream); service.Enable(store); }}private void OnClosing(object sender, System.ComponentModel.CancelEventArgs e) { AnnotationService service = AnnotationService.GetService(fdpv); if (service != null && service.IsEnabled) { service.Disable(); AnnotationStream.Close(); }}

Answer: C
Question: 10
You are creating a Windows Presentation Foundation application. You create a window for the application. The application contains an audio file named AudioFileToPlay.wav. You need to ensure that the audio file is played each time you click the client area of the window. What should you do?
A. Add the following XAML line of code to the window. <MediaElement Source=”AudioFileToPlay.wav” />
B. Add the following code segment to the window constructor method in the code-behind file. SoundPlayer player = new SoundPlayer();player.SoundLocation = “AudioFileToPlay.wav”;player.Play();
C. Add the following code segment to the window MouseDown method in the code-behind file. MediaPlayer player = new MediaPlayer();player.SetValue(MediaElement.SourceProperty,new Uri(“AudioFileToPlay.wav”, UriKind.Relative));player.Play();
D. Add the following XAML code fragment to the window. <Window.Triggers> <EventTrigger RoutedEvent=”Window.MouseDown”> <EventTrigger.Actions> <SoundPlayerAction Source=”AudioFileToPlay.wav”/> </EventTrigger.Actions> </EventTrigger></Window.Triggers>

Answer: D
You create a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5. The application includes a window that displays a rectangle. You need to transform the rectangle by rotating it 45 degrees. Which XAML code fragment should you use?
A. <Rectangle.RenderTransform> <TranslateTransform X=”45″ Y=”45″ /></Rectangle.RenderTransform>
B. <RectangleGeometry.Transform> <RotateTransform CenterX=”40″ CenterY=”70″ Angle=”45″ /></RectangleGeometry.Transform>
C. <Rectangle.RenderTransform> <SkewTransform CenterX=”25″ CenterY=”25″ AngleX=”0″ AngleY=”45″ /></Rectangle.RenderTransform>
D. <Rectangle.RenderTransform> <ScaleTransform CenterX=”0″ CenterY=”0″ ScaleX=”45″ ScaleY=”45″ /></Rectangle.RenderTransform>

Answer: B
Question: 12
You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5. The application contains a custom event handler. You need to ensure that the custom event handler always executes when the event occurs, even if the Handled property is set to true. What should you do?
A. Set the HandledEventsToo property to true in the event definition code segment.
B. Set the HandledEventsToo property to false in the event definition code segment.
C. Set the HandledEventsToo property to true in the event definition XAML code fragment.
D. Set the HandledEventsToo property to false in the event definition XAML code fragment.

Answer: A
Question: 13
You are creating a Windows Presentation Foundation application by using Microsoft .NET
Framework 3.5.
You add a CommandBinding element to the Window element. The command has a keyboard gesture
CTRL+H. The Window contains the following MenuItem control.
<MenuItem Header=”Highlight Content” Command=”local:CustomCommands.Highlight” />
You need to ensure that the MenuItem control is disabled and the command is not executable when
the focus shifts to a TextBox control that does not contain any text. What should you do?

A. Set the IsEnabled property for the MenuItem control in the GotFocus event handler for the TextBox controls.
B. Set the CanExecute property of the command to Highlight_CanExecute. Add the following method to the code-behind file for the window. private void Highlight_CanExecute(object sender, CanExecuteEventArgs e) { TextBox txtBox = sender as TextBox; e.CanExecute = (txtBox.Text.Length > 0);}
C. Set the CanExecute property of the command to Highlight_CanExecute. Add the following method to the code behind file for the window. private void Highlight_CanExecute(object sender, CanExecuteEventArgs e) { TextBox txtBox = e.Source as TextBox; e.CanExecute = (txtBox.Text.Length > 0);}
D. Set the CanExecute property of the command to Highlight_CanExecute. Add the following method to the code behind file for the window. private void Highlight_CanExecute(object sender, CanExecuteEventArgs e) { MenuItem menu = e.Source as MenuItem; TextBox txtBox = menu.CommandTarget as TextBox; Menu.IsEnabled = (txtBox.Text.Length > 0);}

Answer: C
Question: 14
You are creating a Windows Presentation Foundation application by using Microsoft .NET
Framework 3.5. The application defines a BrowserWindow class. Each instance of the
BrowserWindow class allows the user to browse a Web site in a separate window. When a new
browser window is opened, the user is redirected to a predefined URL.
You write the following code segment.
01 private void OpenNewWindow(object sender, RoutedEventArgs e) 02 {
03 Thread newWindowThread = new Thread(new ThreadStart(NewThreadProc));
04
05 newWindowThread.Start();
06 }
07 private void NewThreadProc()
08 {
09
10 }
You need to ensure that the following requirements are met:
The main window of the application is not blocked when an additional browser window is created.
The application completes execution when the main window of the application is closed. What
should you do?

A. Insert the following code segment at line 04. newWindowThread.SetApartmentState(ApartmentState.STA);newWindowThread.IsBackground = true; Insert the following code segment at line 09. BrowserWindow newWindow = new BrowserWindow();newWindow.Show();Application app = new Application();app.Run(newWindow);
B. Insert the following code segment at line 04. newWindowThread.IsBackground = true; Insert the following code segment at line 09. newWindowThread.SetApartmentState(ApartmentState.STA);BrowserWindow newWindow = new BrowserWindow();newWindow.Show();Application app = new Application();app.Run(newWindow);
C. Insert the following code segment at line 04. newWindowThread.SetApartmentState(ApartmentState.STA);newWindowThread.IsBackground = false; Insert the following code segment at line 09. BrowserWindow newWindow = new BrowserWindow();System.Windows.Threading.Dispatcher.Run();newWindow.Show();
D. Insert the following code segment at line 04. newWindowThread.SetApartmentState(ApartmentState.STA);newWindowThread.IsBackground = true; Insert the following code segment at line 09. BrowserWindow newWindow = new BrowserWindow();newWindow.Show();System.Windows.Threading.Dispatcher.Run();

Answer: D
Question: 15
You are creating a Windows Presentation Foundation browser application by using Microsoft .NET
Framework 3.5.
The application contains a PageFunction class named CustomerPage.
You need to ensure that the CustomerPage page function can perform the following tasks:
Accept a customer ID in the form of a string.
Allow the user to update customer information on the page.
Return an instance of a Customer object with the updated information. Which class definition should
you use?

A. public partial class CustomerPage : PageFunction<String> { public CustomerPage(string customerID) { … }}
B. public partial class CustomerPage : PageFunction<Customer> { public CustomerPage(string c) { … }}
C. public partial class CustomerPage : PageFunction<String> { public CustomerPage() { … } public Customer ReturnCustomer(string customerID) { … }}
D. public partial class CustomerPage : PageFunction<Customer> { public CustomerPage() { … } public Customer ReturnCustomer(string customerID) { … }}
Answer: B

Get certified Microsoft 70-502 is a guaranteed way to succeed with IT careers.We help you do exactly that with our high quality Microsoft 70-502 Certification Certified Information Systems Security Professional training materials.

microdess
We are a team that focuses on tutoring Microsoft series certification exams and is committed to providing efficient and practical learning resources and exam preparation support to candidates. As Microsoft series certifications such as Azure, Microsoft 365, Power Platform, Windows, and Graph become more and more popular, we know the importance of these certifications for personal career development and corporate competitiveness. Therefore, we rely on the Pass4itsure platform to actively collect the latest and most comprehensive examination questions to provide candidates with the latest and most accurate preparation materials. MICROSOFT-TECHNET not only provides the latest exam questions, but also allows candidates to find the required learning materials more conveniently and efficiently through detailed organization and classification. Our materials include a large number of mock test questions and detailed analysis to help candidates deeply understand the test content and master the answering skills, so as to easily cope with the test. In addition, we have also specially launched exam preparation materials in PDF format to facilitate candidates to study and review anytime and anywhere. It not only contains detailed analysis of exam questions, but also provides targeted study suggestions and preparation techniques so that candidates can prepare more efficiently. We know that preparing for exams is not just about memorizing knowledge points, but also requires mastering the correct methods and techniques. Therefore, we also provide a series of simulation questions so that candidates can experience the real examination environment in the simulation examination and better adapt to the examination rhythm and atmosphere. These simulation questions can not only help candidates test their preparation results, but also help candidates discover their own shortcomings and further improve their preparation plans. In short, our team always adheres to the needs of candidates as the guide and provides comprehensive, efficient and practical test preparation support to candidates. We believe that with our help, more and more candidates will be able to successfully pass the Microsoft series certification exams and realize their career dreams.