In this article you will learn about conditional formatting of items in an items control.
When developing XAML based applications for Windows Store and Windows Phone we encounter situations when we are binding data with an ItemsControl and the data template needs to show data that is not the same for all the items. ListView, GridView, FlipView and ListBox are most the common ItemsControl to which this discussion is applicable.Here in this article I will try to explain broadly two options.1. Item Template SelectorThis is the most common and obvious solution where you can define as many data templates as necessary in Resources and then implement. This is typically how you would implement an Item Template Selector.
Cons:
2. Value ConverterA Value Converter is primarily used to change values when displaying stuff on the screen but they are also handy in this type of situation. In this approach we mostly deal with Visibility via Boolean to Visibility or its negation and so on. Refer to following XAML that will produce the same output as before (if the data does not change at runtime).
Windows Phone 7 Hileleri