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

Question: You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create a Windows Presentation Framework (WPF) application. You have a page named myPage that contains the following code fragment.
<Page.Resources>
<SolidColorBrush x:Key="CustomerNameBrush" Color="SkyBlue"/>
</Page.Resources>

You need to ensure that other pages in your application can use CustomerNameBrush. What should you do?

  1. Move CustomerNameBrush to the App.xaml file.
  2. Inherit from myPage in all additional pages that use CustomerNameBrush.
  3. Add a reference to myPage to all additional pages that use CustomerNameBrush.
  4. Bind controls that need CustomerNameBrush to myPage.Resources.CustomerNameBrush.

Correct Answer: 1


Question: You use Microsoft .NET Framework 4 to create a custom Windows Presentation Foundation (WPF) application. Your environment includes several WPF applications. The applications use the same logo and style configuration as part of a corporate standard. You need to ensure that the existing applications can be updated to use the same logo and style settings without recompiling. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

  1. Mark the resource as an embedded resource in each application.
  2. Create a resource in an XAML file that contains the logo and style configurations.
  3. Create a resource in a custom control that contains the logo and style configurations.
  4. Add the resource as a ResourceDictionary in the MergedDictionaries collection of each application.
  5. Use ResourceManager to read the content of the resource. Manually assign the style configurations included in the resource file to the appropriate control in each application.

Correct Answer: 2 & 4


Question: You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create a Windows Presentation Framework (WPF) application. You have a company logo that must appear on multiple forms in the application. The logo design changes frequently. You need to ensure that when the logo image is changed, you only need to update a single location. What should you do?

  1. Define the image as a page resource.
  2. Define the image as an application resource.
  3. Save the image on a network drive.
  4. Include the image as an embedded resource.

Correct Answer: 2


Question: You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. You create a window named ManageOrders that contains a Button control named showOtherSide. You add an animation named FlipSides as a resource of ManageOrders. You need to ensure that the following requirements are met:

  • FlipSides runs each time a user clicks showOtherSide.
  • FlipSides runs only when a user clicks showOtherSide.

What should you do?

  1. Add a property trigger to the Triggers collection of ManageOrders. Configure the property trigger to be based on the IsPressed property of showOtherSide.
  2. Add an event trigger to the Triggers collection of ManageOrders. Configure the event trigger to be based on the Click event of showOtherSide.
  3. Call the BeginAnimation method of showOtherSide. Pass FlipSides as a parameter of the BeginAnimation method.
  4. Call the BeginAnimation method of ManageOrders. Pass FlipSides as a parameter of the BeginAnimation method.

Correct Answer: 2


Question: You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. The application contains a form named frmMain that contains a button named btnSave. You create a ProgressBar control named saveProgress. Initially, saveProgress is not displayed on frmMain. When a user clicks btnSave, you have the following requirements:

  • saveProgress is slightly visible after 0.2 seconds
  • saveProgress is fully visible after 1 second

You need to declare the corresponding storyboard. You write the following code fragment. (Line numbers are included for reference only.)
01<Storyboard x:Key=”animateProgress” TargetName=”saveProgress”>
02
03</Storyboard>
Which code fragment should you insert at line 02 to complete the declaration?

  1. <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility">
    <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{x:Static Visibility.Collapsed}" />
    <DiscreteObjectKeyFrame KeyTime="00:00:01" Value="{x:Static Visibility.Visible}" />
    </ObjectAnimationUsingKeyFrames>
  2. <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility">
    <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Collapsed}" />
    <DiscreteObjectKeyFrame KeyTime="1" Value="{x:Static Visibility.Visible}" />
    </ObjectAnimationUsingKeyFrames>
  3. <DoubleAnimation Storyboard.TargetProperty="Opacity" Duration="00:00:01" From="0" To="1" />
  4. <DoubleAnimation Storyboard.TargetProperty="Opacity" Duration="1" From="0" To="1" />

Correct Answer: 2

Tagged . Bookmark the permalink.

Leave a Reply