70-502(CSharp) pdf(49 to 64) for IT examinee: Mar 2016 Edition

★ Pass on Your First TRY ★ 100% Money Back Guarantee ★ Realistic Practice Exam Questions

Free Instant Download NEW 70-502(CSharp) Exam Dumps (PDF & VCE):
Available on: https://www.certleader.com/70-502(CSharp)-dumps.html


70-502(CSharp) Product Description:
Exam Number/Code: 70-502(CSharp) vce
Exam name: TS: MS.NET Frmewrk3.5, Wndws Presentation Fndation App Dev
n questions with full explanations
Certification: Microsoft Certification
Last updated on Global synchronizing

Instant Access to Free VCE Files: Microsoft 70-502(CSharp) TS: MS.NET Frmewrk3.5, Wndws Presentation Fndation App Dev

70-502(CSharp) examcollection

Certified of 70-502(CSharp) practice exam materials and prep for Microsoft certification for examinee, Real Success Guaranteed with Updated 70-502(CSharp) pdf dumps vce Materials. 100% PASS Today!

2016 Mar 70-502(CSharp) Study Guide Questions:

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

 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? 

A. <Paragraph> 

   <Image Source="NancyAnderson.jpg" Width="150" />

   "Education includes a BA in psychology from Colorado State University in 1970.

   She also completed 'The Art of the Cold Call.' Nancy is a member of Toastmasters International."

</Paragraph> 

B. <Floater Width="200"> 

  <BlockUIContainer> 

    <Image Source="NancyAnderson.jpg" Width="150" /> 

  </BlockUIContainer> 

  <Paragraph> 

    "Education includes a BA in psychology from Colorado State University in 1970.

    She also completed 'The Art of the Cold Call.' Nancy is a member of Toastmasters International." 

  </Paragraph>

</Floater> 

C. <Figure Width="200"> 

  <BlockUIContainer> 

    <Image Source="NancyAnderson.jpg" Width="150" /> 

  </BlockUIContainer> 

  <Paragraph> 

    "Education includes a BA in psychology from Colorado State University in 1970.  

    She also completed 'The Art of the Cold Call.' Nancy is a member of Toastmasters International." 

  </Paragraph>

</Figure> 

D. <Section>

  <BlockUIContainer> 

    <Image Source="NancyAnderson.jpg" Width="150" /> 

  </BlockUIContainer> 

  <Paragraph> 

    "Education includes a BA in psychology from Colorado State University in 1970.

    She also completed 'The Art of the Cold Call.' Nancy is a member of Toastmasters International." 

  </Paragraph>

</Section> 

Answer: B


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

You write the following XAML code fragment. 

<Grid> 

  <Grid.ColumnDefinitions> 

    <ColumnDefinition /> 

    <ColumnDefinition Width="Auto" /> 

    <ColumnDefinition /> 

  </Grid.ColumnDefinitions> 

  <Button Grid.Column="0">Left</Button> 

  <Button Grid.Column="2">Right</Button> 

</Grid> 

You need to perform the following tasks: 

 Ensure that the columns that hold the Button controls can be resized by dragging a line between them. 

 Ensure that only a space of 5 device-independent pixels remains between the two Button controls. 

Which XAML code fragment should you use? 

A. <GridSplitter Grid.Column="1" Width="5" /> 

B. <GridSplitter Grid.Column="1" Grid.RowSpan="2" Width="5" /> 

C. <GridSplitter Grid.Column="1" ResizeBehavior="PreviousAndNext" Width="5" /> 

D. <GridSplitter Grid.Column="1" ResizeBehavior="PreviousAndCurrent" Width="5" /> 

Answer: C


70-502(CSharp) exam prep

Updated 70-502(CSharp) test preparation:

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

A. stack.Resources.Add("Button", style);

B. stack.Resources.Add(btOpen.GetType(), style);

C. stack.Resources.Add("{x:Type Button}", style);

D. stack.Resources.Add("System.Windows.Control.Button", style); 

Answer: B


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

You plan to implement a Textbox control that can increase or decrease a numeric value. You install two buttons named button1 and button2. 

You need to ensure that the following requirements are met: 

 From the time the user presses button1 to the time the user releases button1, the numeric value will continue to increase. 

 From the time the user presses button2 to the time the user releases button2, the numeric value will continue to decrease. 

What should you do? 

A. Replace the Button controls with the ToggleButton controls. 

B. Replace the Button controls with the RepeatButton controls. 

C. Use the MouseLeftButtonUp event instead of the Click event to trigger the modification of the number. 

D. Use the MouseRightButtonUp event instead of the Click event to trigger the modification of the number. 

Answer: B


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

You plan to define three columns for a Grid control. 

You need to ensure that the column definition meets the following requirements: 

 The central column is twice as wide as the side columns. 

 The columns occupy all the available horizontal space. 

Which XAML code fragment should you use? 

A. <Grid>

  <Grid.ColumnDefinitions>

    <ColumnDefinition Width="*" /> 

    <ColumnDefinition Width="2*" />

    <ColumnDefinition Width="*" />

  </Grid.ColumnDefinitions>

</Grid> 

B. <Grid>

  <Grid.ColumnDefinitions>

    <ColumnDefinition Width="*" /> 

    <ColumnDefinition Width="2" />

    <ColumnDefinition Width="*" /> 

  </Grid.ColumnDefinitions>

</Grid> 

C. <Grid>

  <Grid.ColumnDefinitions>

    <ColumnDefinition Width="1" /> 

    <ColumnDefinition Width="2" />

    <ColumnDefinition Width="1" />

  </Grid.ColumnDefinitions>

</Grid> 

D. <Grid>

  <Grid.ColumnDefinitions>

    <ColumnDefinition Width="25" /> 

    <ColumnDefinition Width="50" />

    <ColumnDefinition Width="25" />

  </Grid.ColumnDefinitions>

</Grid> 

Answer: A


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

A. Blue 

B. Green 

C. Yellow 

D. Magenta 

Answer: C


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

You write the following XAML code fragment. 

(Line numbers are included for reference only.) 

01 <DockPanel> 

02   <DockPanel.Resources> 

03     <Style TargetType="Button"> 

04       <Style.Triggers> 

05 

06       </Style.Triggers> 

07     </Style> 

08   </DockPanel.Resources> 

09   <Button Content="Cut"> 

10     <Button.Triggers> 

11 

12     </Button.Triggers> 

13   </Button> 

14 </DockPanel> 

You need to ensure that the following requirements are met: 

 When the mouse is over the button, the foreground of the button turns yellow. 

 When the button is pressed, the foreground of the button turns green. 

What should you do? 

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

<Trigger Property="Button.IsMouseOver" Value="True"> 

  <Setter Property="Button.Foreground" Value="Yellow"/>

</Trigger>

<Trigger Property="Button.IsPressed" Value="True"> 

  <Setter Property="Button.Foreground" Value="Green"/>

</Trigger> 

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

<Trigger Property="Button.IsPressed" Value="True"> 

  <Setter Property="Button.Foreground" Value="Green"/>

</Trigger>

<Trigger Property="Button.IsMouseOver" Value="True"> 

  <Setter Property="Button.Foreground" Value="Yellow"/>

</Trigger> 

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

<Trigger Property="IsMouseOver" Value="True"> 

  <Setter Property="Foreground" Value="Yellow"/>

</Trigger>

<Trigger Property="IsPressed" Value="True"> 

  <Setter Property="Foreground" Value="Green"/>

</Trigger> 

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

<Trigger Property="IsPressed" Value="True"> 

  <Setter Property="Foreground" Value="Green"/>

</Trigger>

<Trigger Property="IsMouseOver" Value="True"> 

  <Setter Property="Foreground" Value="Yellow"/>

</Trigger> 

Answer: C


70-502(CSharp) latest exam

100% Guarantee 70-502(CSharp) practice:

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

The application will be translated into several languages. A TextArea control in the application contains text that will be translated. You need to add a comment for the person who will be translating the text. 

What should you do? 

A. Add a Resources attribute to the TextArea control. Write the comment as a value of this attribute by using the appropriate syntax. 

B. Add a TextDecorations attribute to the TextArea control. Write the "Comments:" string as a value of this attribute. Add the comment to the string. 

C. Add a Localization.Comments attribute to the TextArea control. Write the comment as a value of this attribute by using the appropriate syntax. 

D. Add a Resources attribute to the TextArea control. Build the application and then use the LocBaml tool to create a text file from the resources that are generated. 

Answer: C


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


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

The application will process legal consent. You use the following code fragment to create a check box and two text boxes. 

<Grid Height="214" Width="282"> 

  <TextBox Height="21" Margin="132,36,30,0" Name="txtAge1" VerticalAlignment="Top" Text=" " /> 

  <TextBox Height="21" Margin="133,81,29,0" Name="txtAge2" VerticalAlignment="Top" Text= " " /> 

  <Label Height="23" Margin="66,0,96,54" Name="label1" VerticalAlignment="Bottom"> 

    <Label.Content> 

      <MultiBinding Converter="{StaticResource myConsentConverter}" ConverterParameter="18"> 

        <Binding ElementName="txtAge1" Path="Text" /> 

        <Binding ElementName="txtAge2" Path="Text" /> 

      </MultiBinding> 

    </Label.Content> 

  </Label> 

</Grid> 

The text boxes are used to enter the age of the applicants. You need to ensure that if you specify a value of 18 or more in the text boxes, the check box is selected.

Which code segment should you use? 

A. public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)

{

  bool isConsent = (float)values[0] >= 18 && (float)parameter >= 18;

  if (isConsent)

    return "Yes";

  return "No";

B. public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)

{

  bool isConsent = (float)values[0] >= 18 && (float)value[1] >= 18;

  if (isConsent)

    return "Yes";

  return "No";

C. public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)

{

  float age1;

  float age2;

  if (!float.TryParse(((TextBox)values[0]).Text, out age1))

    return "No";

  if (!float.TryParse(((TextBox)values[1]).Text, out age2))

    return "No";

  if (age1 >= (float)parameter && age2 >= parameter)

    return "Yes";

  return "No";

}

D. public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)

{

  float age1;

  float age2;

  if (!float.TryParse((string)values[0], out age1))

    return "No";

  if (!float.TryParse((string)values[1], out age2))

    return "No";

  if (age1 >= (float)parameter && age2 >= parameter)

    return "Yes";

  return "No";

}

Answer: D


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

A. owner.Handle = helper.Owner;

DialogResult db = new DialogResult();

return db;

B. owner.Handle = helper.Owner

return dialog.ShowDialog(owner);

C. owner.Handle = helper.Owner ;

Nullable<bool> result = wpfParent.ShowDialog();

if (result.HasValue)

{

  if (result.value)

    return System.Windows.Forms.DialogResult.OK;

  else

    return System.Windows.Forms.DialogResult.Cancel;

}

else 

  return System.Windows.Forms.DialogResult.Cancel;

D. owner.Handle = helper.Handle:

Nullable<bool> result = wpfParent.ShowDialog();

if (result.HasValue)

{

  if (result.value)

    return System.Windows.Forms.DialogResult.OK;

  else

    return System.Windows.Forms.DialogResult.Cancel;

}

else 

  return System.Windows.Forms.DialogResult.Cancel;

}

Answer: B


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

A. theBitmapImage.UriSource = new Uri("imageToDisplay.jpg")

theBitmapImage.DecodePixelWidth = 200 

B. theBitmapImage.BeginInit()

theBitmapImage.UriSource = New Uri("imageToDisplay.jpg")

theBitmapImage.EndInit() 

C. theBitmapImage.BeginInit()

theBitmapImage.UriSource = New Uri("imageToDisplay.jpg")

theBitmapImage.DecodePixelWidth = 200

theBitmapImage.EndInit() 

D. theBitmapImage.BeginInit()

theBitmapImage.UriSource = New Uri("imageToDisplay.jpg")

theBitmapImage.EndInit()

theBitmapImage.DecodePixelWidth = 200

theBitmapImage.DecodePixelHeight = 200 

Answer: C


Q64. 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 following requirements are met: 

 The audio file is played each time you click the client area of the window. 

 The window provides optimal performance when the audio file is being played. 

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. 

MediaElement  player = new MediaElement();

player.Source = new Uri("AudioFileToPlay.wav", UriKind.Relative);

player.LoadedBehavior = MediaState.Manual;

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



see more TS: MS.NET Frmewrk3.5, Wndws Presentation Fndation App Dev