SevenDays
SevenDays

Reputation: 3768

binding two values windows phone

I need to something like

 <TextBlock
 Grid.Column="2"
 Text="{Binding FirstName,LastName}"
  VerticalAlignment="Center"/>

The Windows Phone sdk(silverlight) doesn't support MultiBinding :( I don't want to use a class that implements joins of two values, I need something faster, because I have a ListBox with about 10 000 values FirstName and LastName

Upvotes: 0

Views: 2321

Answers (1)

Georgi Stoyanov
Georgi Stoyanov

Reputation: 1218

You should add a FullName property to your ViewModel or whatever object you are using as a DataContext. The value is not stored anywhere you just calculate it at run-time from the values of FirstName and LastName. The cost of concatenating two strings is negligible compared to the cost of fetching those 10000 records from a web service or from the isolated storage, so you shouldn't be worrying about that. If there are performance issues, you should implement some form of virtualization instead.

Upvotes: 2

Related Questions