Recreating the PhoneListBoxItemLayout (and why we cut it)

One of the controls that was shipped in the Mix CTPs of Windows Phone Developer Tools was the PhoneListBoxItemLayout control. We removed this for the Beta, and naturally people are asking how to get it back.

Basically the answer is to copy the template from an App.xaml file that was created with the Mix tools, and to make it a data template for a standard Silverlight ListBox/ItemTemplate instead of for the custom PhoneListBoxItemLayout class. That gets you half way there; the other part is re-creating the properties like Title, Details, SecondaryContent, and so on. The answer here is to create a ViewModel class that best fits your needs. You can easily create a class that works the same way as the old PhoneListBoxItemLayout either by implementing INotifyPropertyChanged on your class or by using DependencyProperties, as described in this MSDN topic. I suspect though that if you were to write it yourself, you would use more meaningful property names than the generic ones we chose...

As to why we cut the feature, the basic reason was that it just made more sense to put this kind of thing into the apps rather than into the core platform. When we initially made the PhoneListBoxItemLayout class (the naming of the control is a story unto itself...) we were trying to make it as easy as possible to match the platform. We had 1- or 2-line layouts, with or without icons, and a catch-all "secondary content" in order to match the built-in application layouts. It also wasn't clear whether Blend was going to make it into the Mix CTP, and creating custom data templates in VS is not as easy as it could be, so it was important to have some nice looking templates nice out-of-the-box.

But as the 1st-party apps added more and more layouts (3 lines, items with custom highlights, etc.) and as we saw more people writing apps with custom layouts in Blend, it became clear that trying to keep up was a losing battle and would just create legacy for the platform (hint: that's not a good thing). So although it causes some pain for developers as they need to update Mix apps to run in the Beta, in the long run I think this was the right choice.