Which binding expression should you use?

You are developing a Silverlight 4 application. The application contains a TextBlock control that has the DataContext property set to an object. The object exposes a property named Today of the DateTime data type. The Today property returns DateTime.Today. You need to display the string “Today is ” concatenated with the value of Today in the TextBlock control by using only XAML. Which binding expression should you use?

You are developing a Silverlight 4 application. The application contains a TextBlock control that has the DataContext property set to an object. The object exposes a property named Today of the DateTime data type. The Today property returns DateTime.Today. You need to display the string “Today is ” concatenated with the value of Today in the TextBlock control by using only XAML. Which binding expression should you use?

A.
{Binding Today, StringFormat=’Today is’}

B.
{Binding Today, StringFormat=’Today is {0}’}

C.
{Binding Today, ConverterParameter=’Today is ‘}

D.
{Binding Today, StringFormat=’Today is {Today}’}



Leave a Reply 0

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