Which value should you set in the CommandParameter property of the Button control?

You are developing an application by using Silverlight 4 and Microsoft .NET Framework 4. You create a class named SendMessageCommand that implements the ICommand interface.
You bind the SendMessageCommand class as a command for a Button control. You need to ensure t hat the SendMessageCommand class receives the Text property of a TextBox control named txtMessage as a parameter. Which value should you set in the CommandParameter property of the Button control?

You are developing an application by using Silverlight 4 and Microsoft .NET Framework 4. You create a class named SendMessageCommand that implements the ICommand interface.
You bind the SendMessageCommand class as a command for a Button control. You need to ensure t hat the SendMessageCommand class receives the Text property of a TextBox control named txtMessage as a parameter. Which value should you set in the CommandParameter property of the Button control?

A.
txtMessage.Text

B.
{Binding txtMessage, Path=TextBox.Text}

C.
{Binding ElementName=txtMessage, Path=Text}

D.
{Binding ElementName=txtMessage, Path=TextBox.Text}



Leave a Reply 0

Your email address will not be published. Required fields are marked *