Which XAML fragment should you use?

You are developing a Silverlight 4 application. The application has a UserControl that has a TextBox named FirstName. You need to display the string “Hello” concatenated with the value
entered in the TextBox. Which XAML fragment should you use?

You are developing a Silverlight 4 application. The application has a UserControl that has a TextBox named FirstName. You need to display the string “Hello” concatenated with the value
entered in the TextBox. Which XAML fragment should you use?

A.
<TextBlock Text=”Hello {Binding Path=Text, ElementName=FirstName}” />

B.
<TextBlock Text=”{Binding Path=Hello, ConverterParameter=FirstName}” />

C.
<TextBlock Text=”{Binding Path=Text, StringFormat=’Hello {FirstName}’}” />

D.
<TextBlock Text=”{Binding Path=Text, ElementName=FirstName, StringFormat=’Hello {0}’}”/>



Leave a Reply 0

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