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

Question: You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. The application contains a set of Button controls. You need to ensure that a button is highlighted when the mouse pointer is located over a button that contains no content. Which code fragment should you use?

  1. <Style TargetType="{x:Type Button}"> ... <Setter Property="Background" Value="Yellow" />
    <Style.Triggers> <MultiTrigger>
    <MultiTrigger.Conditions> <Condition Property="IsMouseOver" Value="True" />
    <Condition Property="Content" Value="{x:Null}" />
    </MultiTrigger.Conditions>
    </MultiTrigger> </Style.Triggers>
    </Style>
  2. <Style TargetType="{x:Type Button}"> ... <Style.Triggers>
    <Trigger Property="IsMouseOver" Value="True">
    <Setter Property="Background" Value="Yellow" />
    </Trigger>
    <Trigger Property="Content" Value="{x:Null}">
    <Setter Property="Background" Value="Yellow" />
    </Trigger>
    </Style.Triggers> </Style>
  3. <Style TargetType="{x:Type Button}"> ... <Setter Property="Background" Value="Yellow" />
    <Style.Triggers>
    <MultiTrigger>
    <MultiTrigger.Conditions>
    <Condition Property="IsMouseOver" Value="True" />
    <Condition Property="Content" Value="Empty" /> </MultiTrigger.Conditions>
    </MultiTrigger>
    </Style.Triggers>
    </Style>
  4. <Style TargetType="{x:Type Button}"> ... <Style.Triggers>
    <Trigger Property="IsMouseOver" Value="True">
    <Setter Property="Background" Value="Yellow" />
    </Trigger>
    <Trigger Property="Content" Value="Empty">
    <Setter Property="Background" Value="Yellow" />
    </Trigger>
    </Style.Triggers>
    </Style>

Correct Answer: 1


Question: You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. The application displays a list of books. You write the following code fragment. (Line numbers are included for reference only.)
01<Window.Resources>
02<XmlDataProvider x:Key=”InventoryData” XPath=”Books”>
03<x:XData>
04<Books xmlns=””>
05<Book Title=”XML in Action” Stock=”in” />
06<Book Title=”Inside C#” Stock=”out” />
07<Book Title=”Introducing Microsoft .NET” Stock=”in”/>
08</Books>
09</x:XData>
10</XmlDataProvider>
11<Style x:Key=”MyItemStyle” TargetType=”{x:Type ListBoxItem}”>
12
13</Style>
14</Window.Resources>
15<ListBox ItemContainerStyle=”{StaticResource MyItemStyle}”>
16<ListBox.ItemsSource>
17<Binding Source=”{StaticResource InventoryData}” XPath=”Book”/>
18</ListBox.ItemsSource>
19<ListBox.ItemTemplate>
20<DataTemplate>
21<TextBlock>
22<TextBlock.Text>
23<Binding XPath=”@Title”/>
24</TextBlock.Text>
25</TextBlock>
26</DataTemplate>
27</ListBox.ItemTemplate>
28</ListBox>
You need to ensure that book titles that are out of stock appear in red. Which code fragment should you insert at line 12?

  1. <Style.Triggers> <Trigger Binding.XmlNamespaceManager="{Binding XPath=@Stock}" Value="out">
    <Setter Property="Foreground" Value="Red" /> </Trigger>
    </Style.Triggers>
  2. <Style.Triggers>
    <Trigger Binding ="{Binding XPath=@Stock}" Value="out"> <Setter Property="Foreground" Value="Red"
    /><DataTrigger>
    </Style.Triggers>
  3. <Style.Triggers>
    <Trigger Binding.XmlNamespaceManager="{Binding XPath=book@Stock}" Value="out"<Setter
    Property="Foreground" Value="Red" /><DataTrigger></Trigger>
    </Style.Triggers>
  4. <Style.Triggers>
    <Data Trigger Binding="{Binding XPath=book@Stock}" Value="out"<Setter Property="Foreground"
    Value="Red" />
    <DataTrigger>
    </Style.Triggers>

Correct Answer: 2


Question: You use Microsoft .NET Framework 4 to create a Windows application. You plan to deploy the application by using Trusted Application Deployment. The application can only be installed by users who have elevated permissions. You need to ensure that users are not prompted for additional permissions when they install the application. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

  1. Obfuscate the assemblies.
  2. Configure the application as online only.
  3. Enable User Account Control (UAC) on all client computers.
  4. Sign the deployment manifest with the publisher’s digital certificate.
  5. Add the publisher of application to the trusted publisher’s store on all client computers.

Correct Answer: 4 & 5


Question: You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. The application contains a ListBox control named lbxItems that is data-bound to a collection of objects. Each object has a DisplayValue property. You add a Button control to the application. You need to ensure that the Content property of the Button control is data-bound to the DisplayValue property of the selected item of lbxItems. Which binding expression should you use?

  1. { Binding ElementName=lbxItems, Source=SelectedItem, Path=DisplayValue }
  2. { Binding Source=lbxItems, ElementName=SelectedItem, Path=DisplayValue }
  3. { Binding ElementName=lbxItems, Path=SelectedItem.DisplayValue }
  4. { Binding Source=lbxItems, Path=SelectedItem.DisplayValue }

Correct Answer: 3


Question: You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. You write the following code fragment.
<TextBox Text="{Binding Path=StringMember}" />
You need to ensure that the StringMember property of the data-bound object is updated immediately when the user types the TextBox control. Which binding expression should you use?

  1. { Binding Path=StringMember, Mode=TwoWay }
  2. { Binding Path=StringMember, NotifyOnSourceUpdated=True }
  3. { Binding Path=StringMember, NotifyOnTargetUpdated=True }
  4. { Binding Path=StringMember, UpdateSourceTrigger=PropertyChanged }

Correct Answer: 4

Tagged . Bookmark the permalink.

Leave a Reply