silverlight - Getting at the Listbox's ItemContainer when data binding -


is there way @ itemcontaner of selected item in listbox? in silverlight 2.0 beta 1 could, container hidden in beta 2 of silverlight 2.0.

i'm trying resize listbox item when unselected specific size , when selected variable size. want relative position of selected item animations. growing variable size , getting relative pasition why need listbox item.

i should clarify i'm not adding items listbox explicitly. using data binding in xaml , datatemplates. have trouble accessing itemcontainer of selected item's datatemplate.

there way obtain panel containing item's uielement , mapping of items uielements. have inherit listbox (this works itemscontrol) , override preparecontainerforitemoverride:

protected override void preparecontainerforitemoverride(dependencyobject element, object item)     {         base.preparecontainerforitemoverride(element, item);         var el = element frameworkelement;         if (el != null)         {             // here elements's panel:             _itemshost = el.parent panel;              // item original item inserted in items or itemssource             // can save mapping between items , frameworelements:             _elementmapping[item] = el;         }     } 

this kind of hackish, works fine.


Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -