PrepAway - Latest Free Exam Questions & Answers

Category: 70-511

Exam 70-511: TS: Windows Applications Development with Microsoft .NET Framework 4

Which code fragment should you use?

You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application.
You add a ListBox to show grouped data.
The ListBox is data-bound to a collection of items. Each item has the Name and State properties.
You need to ensure that the ListBox meets the following requirements:
* Names grouped by State
* Names sorted in ascending order
* States sorted in descending order
Which code fragment should you use?

What should you do?

You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application.
You add a ListBox control to the application. The ListBox control is data-bound to an instance of a custom collection class of the Product objects named ProductList.
You need to ensure that changes to ProductList are automatically reflected in the ListBox control.
What should you do?

What should you do?

You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application.
You add a ListBox control to the application. The ListBox control is data-bound to an instance of a custom collection class of the Product objects named ProductList.
The number of items of the data-bound collection is fixed. However, users can modify the properties of each of the Product objects in the collection.
You need to ensure that changes made on the Product objects are automatically reflected in the ListBox control.
What should you do?

What should you do?

You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application.
You write the following code fragment.
<Window x:Class=”MyProject.MainWindow” xmlns:local=”clr-namespace:MyProject”>
<Window.Resources>
<local:AverageConverter x:Key=”avgConverter” />
</Window.Resources>
<StackPanel Orientation=”Vertical”>
<Slider x:Name=”sld01″ Minimum=”0″ Maximum=”100″ />
<Slider x:Name=”sld02″ Minimum=”0″ Maximum=”50″ />
<Slider x:Name=”sld03″ Minimum=”0″ Maximum=”50″ />
<TextBlock> <TextBlock.Text>
<MultiBinding Converter=”{StaticResource avgConverter}”>
<Binding ElementName=”sld01″ Path=”Value” />
<Binding ElementName=”sld02″ Path=”Value” />
<Binding ElementName=”sld03″ Path=”Value” />
</MultiBinding> </TextBlock.Text>
</TextBlock>
</StackPanel>
</Window>
You need to implement the MyProject.AverageConverter class.
What should you do?

What should you do?

You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application.
You write the following code fragment.
<Window x:Class=”MyProject.MainWindow” xmlns:local=”clr-namespace:MyProject”>
<Window.Resources>
<local:MyConverter x:Key=”myConverter” />
</Window.Resources>
<ListBox Name=”box”>
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text=”{Binding Converter={StaticResource myConverter}, ConverterParameter=formatText}”
Background=”{Binding Converter={StaticResource myConverter},
ConverterParameter=formatColor}” IsEnabled=”{Binding Converter={StaticResource myConverter}}” />
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox> </Window>
You need to implement the MyProject.MyConverter class.
What should you do?

Which binding expression should you use?

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?

Which binding expression should you use?

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?

Which two actions should you perform?

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

Which code fragment should you insert at line 12?

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?


Page 8 of 13« First...678910...Last »