Exam 70-511 : Windows Applications Development with Microsoft .NET Framework 4 Part – 8

Question: You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. You create a game where a ball drops from the top to the bottom of a window. You plan to create a single animation for the game. You need to ensure that the animation shows the ball bounce. What should you do?

  1. Use the KeySpline property of a SplineDoubleKeyFrame object.
  2. Use the EasingFunction property of an EasingDoubleKeyFrame object.
  3. Use the DecelerationRatio and AutoReverse properties of a StoryBoard object.
  4. Use the DecelerationRatio and AccelerationRatio properties of a StoryBoard object.

Correct Answer: 2


Question: You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. You add a custom command as a resource. The key of the command is saveCommand. You write the following code fragment. (Line numbers are included for reference only.)
01<Canvas>
02
03<Button>
04
05</Button>
06</Canvas>
You need to ensure that saveCommand is executed when the user clicks the Button control. What should you do?

  1. Insert the following code fragment at line 04.
    <Button.Command>
    <StaticResource ResourceKey="saveCommand" />
    </Button.Command>
  2. Insert the following code fragment at line 04.
    <Button.CommandBindings>
    <CommandBinding Command="{StaticResource saveCommand}" />
    </Button.CommandBindings>
  3. Insert the following code fragment at line 02.
    <Canvas.CommandBindings> <CommandBinding Command="{StaticResource saveCommand}" />
    </Canvas.CommandBindings>

    Replace line 03 with the following code fragment.
    <Button CommandTarget="{Binding RelativeSource={RelativeSource Self}, Path=Parent}">
  4. Insert the following code fragment at line 02.
    <Canvas.CommandBindings> <CommandBinding Command="{StaticResource saveCommand}" />
    </Canvas.CommandBindings>

    Replace line 03 with the following code fragment.
    <Button CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Parent}">

Correct Answer: 1


Question: You use Microsoft .NET Framework 4 to create a Windows Presentation Framework (WPF) application. You plan to create a custom control that contains four text input fields. Each of the text input fields within the control will contain a label. You need to ensure that the text input fields within the control can be validated by using a regular expression validator. Which class should you inherit from?

  1. TextBox
  2. TextElement
  3. UIElement
  4. UserControl

Correct Answer: 4


Question: You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. The application has multiple data entry windows. Each window contains controls that allow the user to type different addresses for shipping and mailing. All addresses have the same format. You need to ensure that you can reuse the controls. What should you create?

  1. a user control
  2. a data template
  3. a control template
  4. a control that inherits the Canvas class

Correct Answer: 1


Question: You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. You write the following code fragment. (Line numbers are included for reference only.)
01<Canvas>
02<Rectangle Stroke=”Red” StrokeThickness=”5″ Height=”60″
03Width=”60″ Canvas.Left=”100″ Canvas.Top=”100″>
04
05</Rectangle>
06</Canvas>
You need to rotate the rectangle by 45 degrees by using its upper-left corner as the axis. Which code fragment should you insert at line 04?

  1. <Rectangle.RenderTransform> <RotateTransform Angle="45" CenterX="0" CenterY="0" />
    </Rectangle.RenderTransform>
  2. <Rectangle.RenderTransform> <RotateTransform Angle="45" CenterX="100" CenterY="100" />
    </Rectangle.RenderTransform>
  3. <Rectangle.LayoutTransform> <RotateTransform Angle="45" CenterX="0" CenterY="0"/>
    </Rectangle.LayoutTransform>
  4. <Rectangle.LayoutTransform> <RotateTransform Angle="45" CenterX="100" CenterY="100"/>
    </Rectangle.LayoutTransform>

Correct Answer: 1

Tagged . Bookmark the permalink.

Leave a Reply