One of many ways, define two DataTemplate
s in page Resources. Then you can set ListBox's ItemTemplate
to any one of those two at run-time :
MyListBox.ItemTemplate = (DataTemplate)FindResource("DataTemplate2");
UPDATE :
Since, FindResource()
function is not available in Windows Phone page, and as confirmed by OP this one works for him, so use following instead of above code :
MyListBox.ItemTemplate = (DataTemplate)this.Resources["DataTemplate2"];