Ensurepass

QUESTION 51

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 lbxItemsthat is data-bound to a collection of objects. Each object has a DisplayValueproperty. 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 DisplayValueproperty of the selected item of lbxItems. Which binding expression should you use?

 

A.    { Binding ElementName=lbxItems, Source=SelectedItem, Path=DisplayValue }

B.    { Binding Source=lbxItems, ElementName=SelectedItem, Path=DisplayValue }

C.    { Binding ElementName=lbxItems, Path=SelectedItem.DisplayValue }

D.    { Binding Source=lbxItems, Path=SelectedItem.DisplayValue }

 

Correct Answer: C

 

 

QUESTION 52

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 StringMemberproperty of the data-bound object is updated immediately when the user types the TextBox control. Which binding expression should you use?

 

A.    { Binding Path=StringMember, Mode=TwoWay }

B.    { Binding Path=StringMember, NotifyOnSourceUpdated=True }

C.    { Binding Path=StringMember, NotifyOnTargetUpdated=True }

D.    { Binding Path=StringMember, UpdateSourceTrigger=PropertyChanged }

 

Correct Answer: D

 

QUESTION 53

You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. You write the following code fragment.

clip_image002

You need to implement the MyProject.MyConverterclass. What should you do?

 

A.    Implement the IValueConverterinterface.

B.    Implement the IMultiValueConverterinterface.

C.    Inherit from the TypeConverterclass.

D.    Apply the TypeConverterAttributeattribute.

 

Correct Answer: A

 

QUESTION 54

You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. You write the following code fragment.

clip_image004

clip_image006

You need to implement the MyProject.AverageConverterclass. What should you do?

 

A.    Implement the IValueConverterinterface.

B.    Implement the IMultiValueConverterinterface.

C.    Inherit from the TypeConverterclass.

D.    Apply the TypeConverterAttributeattribute.

 

Correct Answer: B

 

 

QUESTION 55

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 Productobjects in the collection. You need to ensure that changes made on the Productobjects are automatically reflected in the ListBoxcontrol. What should you do?

 

A.    Implement the INotifyPropertyChangedinterface in the Productclass.

B.    Implement the INotifyCollectionChangedinterface in the ProductListclass.

C.    Set the Mode property of the Bindingobject of the ListBox control to TwoWay.

D.    Set the UpdateSourceTriggerproperty of the Bindingobject of the ListBox control to PropertyChanged.

 

Correct Answer: A

 

 

QUESTION 56

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 ProductListare automatically reflected in the ListBox control. What should you do?

 

A.    Implement the INotifyPropertyChangedinterface in the Productclass.

B.    Implement the IQueryable<Product>interface in the ProductListclass.

C.    Extend the DependencyObjectclass in the Product class.

D.    Extend the ObservableCollection<Product>class in the ProductListclass.

 

Correct Answer: D

 

 

QUESTION 57

You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application.

You add a ListBox to show grouped data. The ListBoxis data-bound to a collection of items. Each item has the Name and State properties. You need to ensure that the ListBoxmeets the following requirements:

·         Names grouped by State

·         Names sorted in ascending order

·         States sorted in descending order

Which code fragment should you use?

 

A.    clip_image008

B.    clip_image010

C.    clip_image012

D.    clip_image014

 

Correct Answer: A

 

 

QUESTION 58

You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application.

You add a TreeView control to show the hierarchical structure of orders and order details. Each order contains an ObservableCollection named OrderDetails. You write the following code fragment. (Line numbers are included for reference only.)

clip_image016

You need to ensure that the TreeView control meets the following requirements:

·         Each order is shown as a TreeView node.

·         The order nodes have order detail nodes as children.

·         The order detail nodes have no children.

Which code fragment should you insert at line 07?

 

A.    clip_image018

B.    clip_image020

C.    clip_image022

D.    clip_image024

 

Correct Answer: B

 

 

QUESTION 59

You use Microsoft .NET Framework 4 to create a Windows application.

You use ClickOnce technology to install the application on computers that run Windows 7 with User Access Control (UAC) enabled. The application requires access to environment variables on each computer. You need to ensure that users who do not have administrative permissions can install the application.

Which deployment method should you use?

 

A.    Start from Web.

B.    Install from Web.

C.    Start from network share

D.    Install from network share.

 

Correct Answer: D

 

 

QUESTION 60

You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application.

You add a DataGrid named gridContactsthat is data-bound to a collection of Contacts. Each item has the ContactNameand Phone properties. The

DataGridcontains a column named ContactNameColumnthat is bound to ContactName. You write the following code fragment.

clip_image026

You need to ensure that the application meets the following requirements:

·         Phonenumber is shown as a row detail when the row is selected.

·         Only ContactNamecan be edited.

What should you do?

 

A.    Set RowDetailsVisibilityModefor gridContactsto VisibleWhenSelected.

Set the IsReadOnlyproperty for gridContactsto False.

Set the IsReadOnlyproperty for ContactNameColumnto False.

 

B.    Set RowDetailsVisibilityModefor gridContactsto VisibleWhenSelected.

Set the IsReadOnlyproperty for gridContactsto True.

Set the IsReadOnlyproperty for ContactNameColumnto False.

 

C.    Set RowDetailsVisibilityModefor gridContactsto Visible.

Set the IsReadOnlyproperty for gridContactsto False.

Set the IsReadOnlyproperty for ContactNameColumnto False.

 

D.    Set RowDetailsVisibilityModefor gridContactsto Collapsed.

Set the IsReadOnlyproperty for gridContactsto True.

Set the IsReadOnlyproperty for ContactNameColumnto False.

 

Correct Answer: A

 

Download Latest MCTS 70-511 Real Free Tests , help you to pass exam 100%.

Comments are closed.