Chris Klug experienced a problem with changing the layout for the selected item in ListBox. The thing that caused troubles, was the fact that it was supposed to show a compact information layout for all items except the selected item. Find out what's the solution of the problem.
The selected item should have a more verbose layout and some extra functionality. Initially that seemed like a tiny problem. That would just be a ItemTemplate with a VisualStateManager. Apparently not…!
Why not? Well…the DataTemplate does not support a VisualStateManager. When you select an item in the ListBox, the VisualStateManager that is used to change the layout is in the items ControlTemplate and not in the items DataTemplate. So the Layout in the DataTemplate does not have the ability to change its layout based on the state.