70-502 software(1 to 16) for candidates: Mar 2016 Edition

100% Correct of 70-502 test materials and pack for Microsoft certification for consumer, Real Success Guaranteed with Updated 70-502 pdf dumps vce Materials. 100% PASS Today!

2016 Mar 70-502 Study Guide Questions:

Q1. You are creating a Windows Presentation Foundation application to track customer orders. 

You use Microsoft .NET Framework 3.5 to create the application. The application contains an Order class. The Order class has two public properties named OrderDate and OrderID. The application also contains an ObservableCollection collection of Order objects. This collection is named OrderItems. You write the following XAML code fragment. 

<Window.Resources> 

  <CollectionViewSource Source="{Binding Source={x:Static Application.Current}, Path=OrderItems}" x:Key="orders" /> 

</Window.Resources> 

You add two ListBox controls to select orders based on the OrderID or the OrderDate properties. One ListBox control displays order dates and the other ListBox control displays order numbers. You need to bind the two ListBox controls so that the item selected in one control is reflected in the other control. 

Which XAML code fragment should you use? 

A.

binding.UpdateSource() 

D.

binding.UpdateTarget() 

Answer: C


70-502 exam guide

Far out 70-502 practice exam:

Q6. You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5. 

You add a Slider control and two buttons to a window of the application. You write the following code fragment.

(Line numbers are included for reference only.) 

01 <StackPanel Orientation="Horizontal"> 

02   <RepeatButton 

03 

04     Content="Left"/> 

05   <Slider Name="slider"/> 

06   <RepeatButton 

07 

08     Content="Right"/> 

09 </StackPanel> 

You need to control the position of the slider thumb by clicking the buttons on the window. 

What should you do? 

A. Insert the following code fragment at line 03. 

Command="Slider.DecreaseSmall" CommandTarget="slider" 

Insert the following code fragment at line 07. 

Command="Slider.IncreaseSmall" CommandTarget="slider" 

B. Insert the following code fragment at line 03. 

Command="DecreaseSmall" CommandTarget="{Binding ElementName=slider}" 

Insert the following code fragment at line 07. 

Command="IncreaseSmall" CommandTarget="{Binding ElementName=slider}" 

C. Insert the following code fragment at line 03. 

Command="Slider.DecreaseSmall" CommandTarget="{Binding ElementName=slider}" 

Insert the following code fragment at line 07. 

Command="Slider.IncreaseSmall" CommandTarget="{Binding ElementName=slider}" 

D. Insert the following code fragment at line 03. 

Command="DecreaseSmall" CommandTarget="slider" 

Insert the following code fragment at line 07. 

Command="IncreaseSmall" CommandTarget="slider" 

Answer: C


Q7. You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5. 

The application contains a data source and a TextBox control named txtUnitPrice. The Text property of the txtUnitPrice control is bound to the data source by using two-way binding. You write the following code segment. 

01 private void OverridePrice(decimal newPrice) 

02 {

03

04    txtUnitPrice.Text = newPrice;

05 }

You need to ensure that after the OverridePrice method is called, changes to the data source do not propagate to txtUnitPrice. 

Which code segment should you insert at line 03? 

A. txtUnitPrice.Clear();

B. txtUnitPrice.DataContext = null;

C. BindingOperations.ClearBinding(txtUnitPrice, TextBox.TextProperty);

D. Binding binding = BindingOperations.GetBinding(txtUnitPrice, TextBox.TextProperty);

binding.NotifyOnSourceUpdated = False 

Answer: C


Q8. You are creating a Windows Presentation Foundation user control by using Microsoft .NET Framework 3.5. 

You need to customize the appearance of all Button controls in the user control such that the following requirements are met: 

 Each Button control has a purple background and white text. 

 Each Button control is rotated 45 degrees. 

 No other Button properties are customized or redefined. 

 The customizations are defined in a single location. 

What should you do? 

A. Use triggers. 

B. Use styles. 

C. Use templates. 

D. Use content presenters. 

Answer: B


Q9. 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? 

A. CroppedBitmap croppedBitmap = new CroppedBitmap(theBitmapImage, new Int32Rect(75, 50, 105, 50));

theImage.Source = theBitmapImage;

B. CroppedBitmap croppedBitmap = new CroppedBitmap();

croppedBitmap.Source = theBitmapImage;

croppedBitmap.SourceRect = new Int32Rect(75, 50, 105, 50);

theImage.Source = theBitmapImage;

C. theImage.Source = theBitmapImage;

EllipseGeometry  clipGeometry = new EllipseGeometry(new Point(75, 50), 50, 25);

theImage.Clip = clipGeometry;

D. theImage.Source = theBitmapImage;

EllipseGeometry clipGeometry = new EllipseGeometry();

clipGeometry.Center = new Point(75, 50);

theImage.Clip = clipGeometry ;

Answer: C


Q10. You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5. 

You add a Slider control and two buttons to a window of the application. You write the following code fragment.

(Line numbers are included for reference only.) 

01 <StackPanel Orientation="Horizontal"> 

02   <RepeatButton 

03 

04     Content="Left"/> 

05   <Slider Name="slider"/> 

06   <RepeatButton 

07 

08     Content="Right"/> 

09 </StackPanel> 

You need to control the position of the slider thumb by clicking the buttons on the window. 

What should you do? 

A. Insert the following code fragment at line 03. 

Command="Slider.DecreaseSmall" CommandTarget="slider" 

Insert the following code fragment at line 07. 

Command="Slider.IncreaseSmall" CommandTarget="slider" 

B. Insert the following code fragment at line 03. 

Command="DecreaseSmall" CommandTarget="{Binding ElementName=slider}" 

Insert the following code fragment at line 07. 

Command="IncreaseSmall" CommandTarget="{Binding ElementName=slider}" 

C. Insert the following code fragment at line 03. 

Command="Slider.DecreaseSmall" CommandTarget="{Binding ElementName=slider}" 

Insert the following code fragment at line 07. 

Command="Slider.IncreaseSmall" CommandTarget="{Binding ElementName=slider}" 

D. Insert the following code fragment at line 03. 

Command="DecreaseSmall" CommandTarget="slider" 

Insert the following code fragment at line 07. 

Command="IncreaseSmall" CommandTarget="slider" 

Answer: C


70-502 exam

Verified 70-502 actual exam:

Q11. You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5. 

The application contains the following elements: 

 A button that has the text content "OK" 

 A button that has the text content "Apply" 

 A button that has the text content "Cancel" 

 A custom control template that updates the appearance of Button controls 

When you apply the custom control template to the three buttons, the buttons appear identical and their content text is not displayed. 

You need to ensure that the content text of each button is displayed. What should you do? 

A. Add a static resource to the application. 

B. Add a dynamic resource to the application. 

C. Update the control template to use a ValueConverter class. 

D. Update the control template to use a TemplateBinding class. 

Answer: D


Q12. 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? 

A. <ControlTemplate.Triggers> 

  <EventTrigger SourceName="buttonImage" RoutedEvent="MouseEnter"> 

    <EventTrigger.Actions> 

      <SoundPlayerAction Source="soundFile.wav" /> 

    </EventTrigger.Actions> 

  </EventTrigger>

</ControlTemplate.Triggers> 

B. <ControlTemplate.Triggers> 

  <EventTrigger SourceName="buttonImage" RoutedEvent="MouseEnter"> 

    <EventTrigger.EnterActions> 

      <SoundPlayerAction Source="soundFile.wav" /> 

    </EventTrigger.EnterActions> 

  </EventTrigger>

</ControlTemplate.Triggers> 

C. <ControlTemplate.Triggers> 

  <EventTrigger RoutedEvent="MouseEnter"> 

    <EventTrigger.EnterActions> 

      <SoundPlayerAction Source="soundFile.wav" /> 

    </EventTrigger.EnterActions> 

  </EventTrigger>

</ControlTemplate.Triggers> 

D. <ControlTemplate.Triggers> 

  <EventTrigger RoutedEvent="MouseEnter"> 

    <EventTrigger.Actions> 

      <SoundPlayerAction Source="soundFile.wav" /> 

    </EventTrigger.Actions> 

  </EventTrigger>

</ControlTemplate.Triggers> 

Answer: A


Q13. 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


Q14. You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5. 

You create a window by using the following XAML code fragment.

(Line numbers are included for reference only.) 

01 <Rectangle x:Name="rect"> 

02   <Rectangle.Fill> 

03     <SolidColorBrush x:Name="brush"/> 

04   </Rectangle.Fill> 

05   <Rectangle.Triggers> 

06     <EventTrigger RoutedEvent="Rectangle.Loaded"> 

07       <BeginStoryboard x:Name="beginName"> 

08         <Storyboard x:Name="boardName"> 

09

10         </Storyboard> 

11       </BeginStoryboard> 

12     </EventTrigger> 

13     <EventTrigger RoutedEvent="Rectangle.MouseLeftButtonDown"> 

14

15     </EventTrigger> 

16   </Rectangle.Triggers> 

17 </Rectangle> 

You need to ensure that the animation starts when the rectangle is loaded. You also need to ensure that the animation terminates when a user clicks the rectangle. 

What should you do? 

A. Insert the following XAML code fragment at line 09. 

<ColorAnimation Storyboard.TargetName="brush" Storyboard.TargetProperty="Color" From="Blue" To="Yellow" RepeatBehavior="Forever"/>

Insert the following XAML code fragment at line 14. 

<StopStoryboard BeginStoryboardName="boardName"/> 

B. Insert the following XAML code fragment at line 09. 

<ColorAnimation Storyboard.TargetName="brush" Storyboard.TargetProperty="Color" From="Blue" To="Yellow" RepeatBehavior="Forever"/> 

Insert the following XAML code fragment at line 14. 

<StopStoryboard BeginStoryboardName="beginName"/> 

C. Insert the following XAML code fragment at line 09. 

<ColorAnimation Storyboard.TargetName="rect" Storyboard.TargetProperty="Color" From="Blue" To="Yellow" RepeatBehavior="Forever"/> 

Insert the following XAML code fragment at line 14. 

<StopStoryboard BeginStoryboardName="beginName"/> 

D. Insert the following XAML code fragment at line 09. 

<ColorAnimation Storyboard.TargetName="rect" Storyboard.TargetProperty="Brush.Color" From="Blue" To="Yellow" RepeatBehavior="Forever"/> 

Insert the following XAML code fragment at line 14. 

<StopStoryboard BeginStoryboardName="beginName"/> 

Answer: B


Q15. You create an assembly by using Microsoft .NET Framework 3.5. 

The assembly creates a new text file in the root of the C: drive. The assembly will be used in a Windows Presentation Foundation standalone application. The assembly will also be used in a Windows Presentation Foundation XAML Browser Application (XBAP). 

The assembly contains the following code segment. 

(Line numbers are included for reference only.) 

01 public void Save()

02 {

03

04   FileStream stream = File.Create("c:\newfile.txt");

05   try

06   {

07     StreamWriter writer = new StreamWriter(stream);

08     try

09     {

10       writer.WriteLine("Bew line in text file");

11     }

12     finally

13     {

14       writer.Dispose();

15     }

16   }

17   finally

18   {

19     stream.Dispose();

20   }

21

22 } 

You need to ensure that the assembly functions without propagating errors in both standalone and XBAP applications.

What should you do? 

A. Configure the assembly to use the Nothing Permission set. 

B. Configure the assembly to use the Partial Trust Permission set. 

C. Demand the FileIOPermissionAccess.Write permission in line 03 and add an exception handler at line 21. 

D. Demand the FileIOPermissionAccess.Append permission in line 03 and add an exception handler at line 21. 

Answer: C


Q16. 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? 

A. The Grid control 

B. The Canvas control 

C. The WrapPanel control 

D. The StackPanel control 

Answer: D