[Realistic] 70-502 Microsoft practice test 49-64 (Apr 2016)

Top Quality of 70-502 actual exam materials and rapidshare for Microsoft certification for IT engineers, Real Success Guaranteed with Updated 70-502 pdf dumps vce Materials. 100% PASS TS: Microsoft .NET Framework 3.5 - Windows Presentation Foundation exam Today!

2016 Apr 70-502 Study Guide Questions:

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

      <scm:SortDescription PropertyValue="CityName"/> 

    </CollectionViewSource.SortDescriptions> 

    <CollectionViewSource.GroupDescriptions> 

      <dat:PropertyGroupDescription PropertyValue="State"/> 

    </CollectionViewSource.GroupDescriptions>

  </CollectionViewSource>

</Window.Resources> 

B.

      <scm:SortDescription PropertyName="State"/> 

    </CollectionViewSource.SortDescriptions> 

    <CollectionViewSource.GroupDescriptions> 

      <dat:PropertyGroupDescription PropertyName="CityName"/> 

    </CollectionViewSource.GroupDescriptions> 

  </CollectionViewSource>

</Window.Resources> 

C.

      <scm:SortDescription PropertyName="CityName"/> 

    </CollectionViewSource.SortDescriptions> 

    <CollectionViewSource.GroupDescriptions> 

      <dat:PropertyGroupDescription PropertyName="State"/> 

    </CollectionViewSource.GroupDescriptions> 

  </CollectionViewSource>

</Window.Resources> 

D.

      <scm:SortDescription PropertyValue="State"/> 

    </CollectionViewSource.SortDescriptions> 

    <CollectionViewSource.GroupDescriptions> 

      <dat:PropertyGroupDescription PropertyValue="CityName"/> 

    </CollectionViewSource.GroupDescriptions>

  </CollectionViewSource>

</Window.Resources> 

Answer: C


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


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


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

The WPF application has a Grid control named rootGrid. 

You write the following XAML code fragment. 

<Window x:Class="MCP.HostingWinFormsControls" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/ presentation" 

   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="HostingWinFormsControls" Loaded="Window_Loaded"> 

  <Grid x:Name="rootGrid"> 

  </Grid> 

</Window> 

You need to ensure that each time the WPF window opens, a Windows Forms control named MyCustomFormsControl is added to rootGrid. 

Which code segment should you use? 

A. private void Window_Loaded(object sender, RoutedEventArgs e)

{

  WindowsFormsHost host = new WindowsFormsHost();

  MyCustomFormsControl formsControl = new MyCustomFormsControl();

  host.Child = formsControl;

  rootGrid.Children.Add(host);

B. private void Window_Loaded(object sender, RoutedEventArgs e)

{

  ElementHost  host = new ElementHost();

  MyCustomFormsControl formsControl = new MyCustomFormsControl();

  host.Child = formsControl;

  rootGrid.Children.Add(host);

}

C. private void Window_Loaded(object sender, RoutedEventArgs e)

{

  MyCustomFormsControl formsControl = new MyCustomFormsControl();

  formsControl.CreateControl();

  HwndTarget target = new HwndTarget(formsControl.Handle);

  UIElement formsElement = (UIElement)target.RootVisual;

  rootGrid.Children.Add(formsElement);

D. private void Window_Loaded(object sender, RoutedEventArgs e)

{

  MyCustomFormsControl  formsControl = new MyCustomFormsControl();

  formsControl.CreateControl();

  HwndSource source = HwndSource.FromHwnd(formsControl.Handle);

  UIElement formsElement = (UIElement)source.RootVisual;

  rootGrid.Children.Add(formsElement);

}

Answer: A


70-502 exam cost

Abreast of the times 70-502 latest exam:

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

The application contains a Person object with a FirstName property. You bind the Person object to a data source that is used in several controls. You need to ensure that the data source is updated whenever the FirstName property changes. 

What should you do? 

A. Use OneWay data binding. 

B. Use OneTime data binding. 

C. Create a PropertyChanged event handler in the application. 

D. Implement the INotifyPropertyChanged interface in the Person object. 

Answer: D


Q55. You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5. You create a window for the application. You need to ensure that the following requirements are met: 

 An array of strings is displayed by using a ListBox control in a two-column format. 

 The data in the ListBox control flows from left to right and from top to bottom. 

Which ListBox control would you use?

A. <ListBox Name="myList"> 

  <ListBox.ItemsPanel> 

    <ItemsPanelTemplate> 

      <UniformGrid Columns="2"/> 

    </ItemsPanelTemplate> 

  </ListBox.ItemsPanel>

</ListBox> 

Use the following C# code to associate the array of strings to the ListBox control. 

myList.ItemsSource = arrayOfString 

B. <ListBox Name="myList"> 

  <ListBox.ItemsPanel> 

    <ItemsPanelTemplate> 

      <StackPanel /> 

    </ItemsPanelTemplate> 

  </ListBox.ItemsPanel>

</ListBox>

Use the following C# code to associate the array of strings to the ListBox control. 

myList.ItemsSource = arrayOfString 

C. <ListBox Name="myList"> 

  <ListBox.ItemsPanel>

    <ItemsPanelTemplate>

      <WrapPanel /> 

    </ItemsPanelTemplate> 

  </ListBox.ItemsPanel>

</ListBox>

Use the following C# code to associate the array of strings to the ListBox control. 

myListView.ItemsSource = arrayOfString 

D. <ListBox Name="myList"> 

  <ListBox.ItemsPanel> 

    <ItemsPanelTemplate> 

      <Grid> 

        <Grid.ColumnDefinitions> 

          <ColumnDefinition /> 

          <ColumnDefinition /> 

        </Grid.ColumnDefinitions>

       </Grid> 

    </ItemsPanelTemplate> 

  </ListBox.ItemsPanel>

</ListBox>

Use the following C# code to associate the array of strings to the ListBox control. 

myList.ItemsSource = arrayOfString 

Answer: A


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

You create a window that has an arbitrary size. You plan to add two Button controls to the window. You need to ensure that each Button control fills exactly half the window space. 

Which XAML code fragment should you use? 

A. <Grid>

  <Button Grid.Column="0">Some content</Button> 

  <Button Grid.Column="1">Another</Button>

</Grid> 

B. <Grid>

  <Button Grid.Column="0" Width="Auto">Some content</Button> 

  <Button Grid.Column="1" Width="Auto">Another</Button>

</Grid> 

C. <Grid>

  <Grid.ColumnDefinitions>

    <ColumnDefinition Width="*" /> 

    <ColumnDefinition Width="*" />

  </Grid.ColumnDefinitions> 

  <Button Grid.Column="0">Some content</Button> 

  <Button Grid.Column="1">Another</Button>

</Grid> 

D. <Grid>

  <Grid.ColumnDefinitions>

    <ColumnDefinition Width="100" /> 

    <ColumnDefinition Width="100" />

   </Grid.ColumnDefinitions> 

  <Button Grid.Column="0">Some content</Button> 

  <Button Grid.Column="1">Another</Button>

</Grid> 

Answer: C


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


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


70-502 exam question

Refined 70-502 :

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

You write the following XAML code fragment. 

<Rectangle Name="SplineTest"> 

  <Rectangle.RenderTransform> 

    <TranslateTransform x:Name="SplineTestTrans" X="0" Y="0" /> 

  </Rectangle.RenderTransform> 

  <Rectangle.Triggers> 

    <EventTrigger RoutedEvent="Rectangle.MouseLeftButtonDown"> 

      <EventTrigger.Actions> 

        <BeginStoryboard> 

          <Storyboard> 

            ... 

          </Storyboard> 

        </BeginStoryboard> 

      </EventTrigger.Actions> 

    </EventTrigger> 

  </Rectangle.Triggers> 

</Rectangle> 

You need to ensure that the Rectangle object shifts diagonally downwards when a user clicks it. 

Which XAML code fragment should you use? 

A. <DoubleAnimation Storyboard.TargetProperty="RenderTransform. (TranslateTransform.X)" From="0" To="200"/> 

B. <DoubleAnimation Storyboard.TargetName= "SplineTestTrans" Storyboard.TargetProperty="RenderTransform.Angle" From="0" To="360" Duration="0:0:1"/> 

C. <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Trans" Storyboard.TargetProperty="Y" Duration="0:0:15"> 

<LinearDoubleKeyFrame Value="350" KeyTime="0:0:7"/> 

<LinearDoubleKeyFrame Value="50" KeyTime="0:0:5"/> 

<LinearDoubleKeyFrame Value="200" KeyTime="0:0:3"/>

</DoubleAnimationUsingKeyFrames> 

D. <DoubleAnimationUsingKeyFrames Storyboard.TargetName="SplineTestTrans" Storyboard.TargetProperty="X" Duration="0:0:15"> 

<SplineDoubleKeyFrame Value="350" KeyTime="0:0:7" KeySpline="0.0,1.0, 1.0,0.0"/>

</DoubleAnimationUsingKeyFrames>

<DoubleAnimationUsingKeyFrames Storyboard.TargetName="SplineTestTrans"Storyboard.TargetProperty="Y" Duration="0:0:15"> 

<SplineDoubleKeyFrame Value="350" KeyTime="0:0:7" KeySpline="0.0,1.0, 1.0,0.0"/>

</DoubleAnimationUsingKeyFrames> 

Answer: D


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


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

You add a window that displays a Button control. You need to ensure that the Button control displays an ellipse that occupies the entire button control area. 

Which code fragment should you use? 

A. <Button MinHeight="20"> 

  <VisualBrush> 

    <VisualBrush.Visual> 

      <Ellipse Width="12.5" Height="25" /> 

    </VisualBrush.Visual> 

  </VisualBrush>

</Button> 

B. <Button MinHeight="20"> 

  <Button.Background> 

    <VisualBrush> 

      <VisualBrush.Visual> 

        <Ellipse Width="12.5" Height="25" /> 

      </VisualBrush.Visual> 

    </VisualBrush> 

  </Button.Background>

</Button> 

C. <Button MinHeight="20"> 

  <GeometryDrawing> 

    <GeometryDrawing.Pen> 

      <Pen Thickness="1" Brush="Black" /> 

    </GeometryDrawing.Pen> 

    <GeometryDrawing.Geometry>

      <EllipseGeometry RadiusX="12.5" RadiusY="25" /> 

    </GeometryDrawing.Geometry> 

  </GeometryDrawing>

</Button> 

D. <Button MinHeight="50">

  <Button.Background> 

    <DrawingBrush> 

      <DrawingBrush.Drawing> 

        <GeometryDrawing> 

          <GeometryDrawing.Pen> 

            <Pen Thickness="1" Brush="Black" /> 

          </GeometryDrawing.Pen> 

          <GeometryDrawing.Geometry> 

            <EllipseGeometry RadiusX="12.5" RadiusY="25" /> 

          </GeometryDrawing.Geometry> 

        </GeometryDrawing> 

      </DrawingBrush.Drawing> 

    </DrawingBrush> 

  </Button.Background>

</Button> 

Answer: D


Q62. 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(Stock.PriceProperty); }

    set { SetValue(Stock.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


Q63. You are creating a Windows Presentation Foundation application. You create the application by using Microsoft .NET Framework 3.5.

You create a window that has two tabs for the application. You associate the following XAML code fragment with the tab control that contains the two tabs. 

<Window.Resources> 

  <c:PetSelection x:Key="myPetSelection" /> 

</Window.Resources> 

You add a property named Index to the PetSelection class. You need to ensure that when the user clicks a tab, the SelectedIndex property value of the tab control is transferred to the Index property of the myPetSelection object. 

Which XAML code fragment should you use? 

A. <TabControl SelectedIndex="{Binding Path=Index, Mode=OneWay, Source={StaticResource myPetSelection}}" IsSynchronizedWithCurrentItem="True"> 

  <TabItem Header="Dogs">Dogs</TabItem> 

  <TabItem Header="Cats">Cats</TabItem>

</TabControl> 

B. <TabControl SelectedIndex="{Binding Path=Index, Mode=OneWayToSource, Source={StaticResource myPetSelection}}" IsSynchronizedWithCurrentItem="True"> 

  <TabItem Header="Dogs">Dogs</TabItem> 

  <TabItem Header="Cats">Cats</TabItem>

</TabControl> 

C. <TabControl SelectedIndex="{Binding Path=Index, Mode=OneTime, Source={StaticResource myPetSelection}}" IsSynchronizedWithCurrentItem="True"> 

  <TabItem Header="Dogs">Dogs</TabItem> 

  <TabItem Header="Cats">Cats</TabItem>

</TabControl> 

D. <TabControl SelectedIndex="{Binding Path=PetSelection, Mode=Default, Source={StaticResource myPetSelection}}" IsSynchronizedWithCurrentItem="True"> 

  <TabItem Header="Dogs">Dogs</TabItem> 

  <TabItem Header="Cats">Cats</TabItem>

</TabControl> 

Answer: B


Q64. 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, CanExecuteRoutedEventArgs e)

{

   TextBox txtBox = (TextBox)sender;

   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, CanExecuteRoutedEventArgs e)

{

   TextBox txtBox = (TextBox)e.Source;

   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, CanExecuteRoutedEventArgs e)

{

   MenuItem Menu = (MenuItem)e.Source ;

   TextBox txtBox = (TextBox)Menu.CommandTarget;

   Menu.IsEnabled = (txtBox.Text.Length > 0);

}

Answer: C



see more 70-502 - TS: Microsoft .NET Framework 3.5 - Windows Presentation Foundation

Microsoft 70-502 Certification Sample Questions and Answers: http://www.braindumpsall.net/70-502-dumps/

P.S. New 70-502 dumps PDF: http://www.4easydumps.com/70-502-dumps-download.html