this has yet to be defined

that is, for you

I’m currently working on a journaling application for WP8. While designing the page for browsing through past entries, I found that I needed to be able to switch between data templates for the LongListSelector housed in the page. Some journal entries would have just text, some would have only a header photo, and some would have both, and I needed to display the entries differently for all three cases.

I found this article describing how to recreate WPF’s DataTemplateSelector class for Windows Phone. It worked fine–after remaking the base abstract class and extending it for my specific case, all you need to do is specify the different data templates in your xaml:

<amp-img width=”768” height=”1280” layout=”responsive” src=”/assets/posts/aligned.png” alt=”“Now every element is taking up the correct amount of space!" title=”“Now every element is taking up the correct amount of space!"></amp-img></figure>