I have a ListBox
that uses a WrapPanel
for its ItemsPanel
, a custom ItemTemplate
, and a custom ItemContainerStyle
. The ItemContainerStyle's template contains a selection box that shows up when an item is selected. The graphics designer would like this selection box to overlap sibling items in the ListBox like it's an overlay.
The first thing I tried was setting the Canvas.ZIndex
property of the ItemContainer in the Selected state. That did not seem to have an effect. Then I read that list items might be wrapped inside of a ContentPresenter
, so I created an attached property that changes the ZIndex of an item's parent, but then I found out Silverlight storyboards don't let you animate custom attached properties.
Does anyone know of a technique we can use to achieve the effect we desire?