PrepAway - Latest Free Exam Questions & Answers

Which combination of the following actions should you take?

You are employed as an application developer at ABC.com. You make use of Microsoft .NET
Framework 4 to develop Windows Presentation Foundation (WPF) applications.
After developing an application, named ABCApp22, you configure a Button control and a
MenuItem control that will be hosted by a window. The Button control and the MenuItem control
have both been named Add.
You have configured the exact same RoutedCommand, named AddCommand, as the Command
properties of these two controls. You then write the code shown below:
Private void CanAdd (object sender, CanExecuteRoutedEventArgs e) { … }
You are then informed that the two controls should be disabled when the CanExecute property is
set to to false.

Which combination of the following actions should you take? (Choose all that apply.)

PrepAway - Latest Free Exam Questions & Answers

A.
You should consider having an event handler configured for the CanExecuteChanged event of
the AddCommand command.

B.
You should consider having a CommandBinding object added to the CommandBindings
property of the window.

C.
You should consider having a CommandBinding object added to the CommandBinding section
of the MenuItem control.

D.
You should consider having the CanAdd method called from within the event handler.

E.
You should consider having the AddCommand inherited from the RoutedUICommand class.

F.
You should consider having the Command property of CommandBinding set to the
AddCommand command.

G.
You should consider having the CanAdd method called from within the constructor of the
AddCommand command.

H.
You should consider having the CanExecute property of the CommandBinding object set to the
CanAdd method.

Explanation:

2 Comments on “Which combination of the following actions should you take?


Leave a Reply