Ensurepass

QUESTION 141

You develop a Windows Presentation Foundation (WPF) application.

This application is used to output data trends to customer service representatives. You use threading to keep the UI responsive. You have a function named UpdateUIthat updates all of the UI components. You use the following code to update the _Data variable. (Line numbers included for reference only.)

clip_image002

You need to update the user interface without knowing if you are on the UI thread. Which code segment should you insert at line 06?

 

A.    clip_image004

B.    clip_image006

C.    clip_image008

D.    clip_image010

 

Correct Answer: D

 

 

QUESTION 142

You are developing a Windows Presentation Foundation (WPF) application.

A custom control has a dependency property that is bound to a property of type Int16 on a business layer object. You need to ensure that the bound value always falls within the range of an Int16 value, even if the value that the user enters does not. What should you do?

 

A.    Within the Dependency property’s metadata, specify a callback for validation.

B.    Register the property type of the Dependency property as Int16.

C.    Specify code in the common language runtime (CLR) wrapper to adjust the value if it falls outside the range of an Int16 value.

D.    Within the Dependency property’s metadata, specify a callback for coercion.

 

Correct Answer: D

 

 

QUESTION 143

You are developing a Windows Presentation Foundation (WPF) application.

A user control responds to a click event. The click event handler sets the Handled property to true. You need to ensure that a parent control responds to the event after the user control’s handler executes. What should you do?

 

A.    Programmatically add an event handler to the parent control and set the HandledEventsTooproperty to true.

B.    Add a tunneling routed event handler to the parent control.

C.    Add a bubbling routed event handler to the parent control.

D.    Programmatically add an event handler to the parent control and set the HandledEventsTooproperty to false.

 

Correct Answer: A

 

 

QUESTION 144

You are developing a Windows Presentation Foundation (WPF) application. A UserControl named userControlcontains the following controls.

clip_image012

You need to ensure that the content of the label displays “New Content!!!” programmatically from the code-behind of the application window that contains the UserControl. Which code segment should you use?

 

A.    clip_image014

B.    clip_image016

C.    clip_image018

D.    clip_image020

 

Correct Answer: A

 

 

QUESTION 145

You are developing a Windows Presentation Foundation (WPF) application. The application contains the following markup.

clip_image022

You need to ensure that the Filtercombo box is hidden when the expander is collapsed. What should you do?

A.    clip_image024

B.    clip_image026

C.    clip_image028

D.    clip_image030

 

Correct Answer: B

 

 

QUESTION 146

You are developing a Windows Presentation Foundation (WPF) application. Users can enter formatted percentages into text boxes. The markup is as follows.

clip_image032

Percentage is a decimal property. You need to store the percentages as their decimal values, not their display values. Which code segment should you use?

 

A.    clip_image034

B.    clip_image036

C.    clip_image038

D.    clip_image040

 

Correct Answer: B

 

 

QUESTION 147

You are developing a Windows Presentation Foundation (WPF) application.

clip_image042

The WPF window contains a ListBox control that displays a list of customer names and genders. You add the following markup segment to the application. (Line

numbers are included for reference only.)

The WPF window renders the list of customers with empty Gender values. You need to convert the null values for Gender to the following string: “Gender Not Specified”. Which binding attribute should you add at line 08?

 

A.            TargetNullValue=”Gender Not Specified”

B.            FallbackValue=”Gender Not Specified”

C.            StringFormat=”Gender Not Specified”

D.            Source=”Gender Not Specified”

 

Correct Answer: A

 

 

QUESTION 148

You are developing a Windows Presentation Foundation (WPF) application.

You add a TextBox control to the design surface and bind it to an underlying window resource named dsGiftCertificate. The control uses the binding XAML as follows.

<Binding Source=”{StaticResource dsGiftCertificate}” UpdateSourceTrigger=”LostFocus” Path=”Coupon” />

You need to provide a custom error message in the tooltip of the TextBox when the user leaves the textbox. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

 

A.    clip_image044

B.    clip_image046

C.    clip_image048

D.    clip_image050

 

Correct Answer: BC

 

 

QUESTION 149

You are developing a Windows Presentation Foundation (WPF) application.

You have a class named Orders, which contains OrderIdand ShipOn properties. You place a control in the MainWindow.xaml file, as follows. (Line numbers are included for reference only.)

clip_image052

When you run the application, the ComboBox control displays the class name for every row. You need to ensure that the ComboBox control displays the OrderId and ShipOn values in columns. Which markup segment should you add at line 03?

 

A.    clip_image054

B.    clip_image056

C.    clip_image058

D.    clip_image060        

 

Correct Answer: C

 

 

QUESTION 150

You are developing a Windows Presentation Foundation (WPF) application.

The application consists of:

·         A window that contains controls organized into groups.

·         Groups that are ordered vertically and that have individual headings.

·         Controls within the groups that are ordered horizontally.

·         Groups and controls that will be added dynamically at run time.

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

·         The window must be resizable without affecting the layout of the controls.

·         The controls within the groups must be laid out such that there is a minimum amount of spacing between groups.

What should you do?

A.    Use a Grid control with its VerticalAlignmentproperty set to Stretchto organize the groups and specify the row definitions. Use Grid controls to organize the controls and specify the column definitions.

B.    Use a WrapPanel control to organize the groups with its Orientationproperty set to Vertical. Use WrapPanel controls to organize the controls with their Orientationproperty set to Horizontal.

C.    Use a ListBox control to organize the groups. Use Canvascontrols to organize the controls.

D.    use a StackPanel control to organize the groups with its Orientationproperty set to Vertical. Use StackPanel controls to organize the controls with their Orientationproperty set to Horizontal.

 

Correct Answer: D

 

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

Comments are closed.