(X) Hide this
    • Login
    • Join
      • Generate New Image
        By clicking 'Register' you accept the terms of use .
        Login with Facebook

Silverlight 4 Binding and StringFormat in XAML

(0 votes)
0 comments   /   posted by Silverlight Show on May 31, 2010
Tags:   bindings , xaml , silverlight-4 , matthias-shapiro
In this post Matthias Shapiro discusses the ability to use the StringFormat feature when binding in Silverlight 4.

Previously, if I wanted to have a piece of text that said “Your name is [username]” I could either use the old Horizontal-Stack-Panel-And-2-TextBlocks trick or write a value converter (not going to be seen below because there’s a great example of it over here. Incidentally, that example is totally irrelevant if you’re going to use StringFormat, but more on that in a second).

The StringFormat option in Silverlight 4 allows you put all that information into a single field, which is extremely useful not only for TextBlocks, but for Content fields in a Button. In fact, let’s use that as an example.


No comments

Add Comment

Login to comment:
  *      *       
Login with Facebook

Our News on Twitter

Latest News