O'Reilly logo

Microsoft® Silverlight® Edition: Programming Windows® Phone 7 by Charles Petzold

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Sorting

In earlier displays of these students, I used the property of Student called FullName to display the student’s name. You may have noticed that the students.xml file was actually sorted by this property, and that’s the order in which the students appeared on the screen. Popular email programs display your contacts sorted by first name, so I figured it wasn’t entirely a bad thing.

But in the most recent DataTemplate, I switched to using the LastName, FirstName, and MiddleName properties, and the unsorted display now looks very strange and just plain wrong.

How can this be fixed?

One approach is through code. It’s possible for the StudentBodyPresenter class to re-sort the data after it’s been downloaded. But you might prefer a more flexible ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required