c# - Wpf - Speed ListBox -


i've got wpf application , i'm having speed/time issues. i've got grid 2 columns. left column contains panel listbox, , when 1 of items selected creates new panel , sets @ right column of grid. i've got fixed panel on left , changing panel on right.

my right panel contains details , listbox. when keep changing right panel (change selection of left panel) gets slow , ui freezes. able find issue, , listbox. has complex itemtemplate , explain why slow.

my listbox itemtemplate:

<datatemplate>     <stackpanel orientation="vertical" verticalalignment="center" horizontalalignment="{binding ., converter={staticresource myconverter}}">         <textbox style="{staticresource mystyle}" text="{binding property, converter={staticresource myconverter}}" horizontalalignment="{binding ., converter={staticresource myconverter}}" fontsize="10" visibility="{binding property, converter={staticresource myconverter}}"/>         <stackpanel orientation="vertical" verticalalignment="center" horizontalalignment="{binding ., converter={staticresource myconverter}}">             <border padding="8" cornerradius="10,10,10,10" background="{binding ., converter={staticresource myconverter}}">                 <stackpanel orientation="vertical">                     <textbox style="{staticresource mystyle}" text="{binding property}" visibility="{binding ., converter={staticresource myconverter}}" fontsize="14" fontweight="demibold" textwrapping="wrap" horizontalalignment="{binding ., converter={staticresource myconverter}}"/>                     <stackpanel orientation="vertical" visibility="{binding property, converter={staticresource myconverter}}" horizontalalignment="center">                         <image source="{binding property, converter={staticresource myconverter}}" maxwidth="800" maxheight="200" visibility="{binding property, converter={staticresource myconverter}}"/>                         <image gif:imagebehavior.animatedsource="imagesource" width="200" maxheight="200" visibility="{binding property, converter={staticresource myconverter}}"/>                     </stackpanel>                     <textbox style="{staticresource mystyle}" text="{binding ., converter={staticresource myconverter}}" fontsize="14" textwrapping="wrap" verticalalignment="stretch" horizontalalignment="{binding ., converter={staticresource myconverter}}"/>                 </stackpanel>             </border>         </stackpanel>         <stackpanel  orientation="horizontal" verticalalignment="center" horizontalalignment="{binding ., converter={staticresource myconverter}}" margin="0, 2, 0, 0" visibility="{binding property, converter={staticresource myconverter}}">             <image source="imagesource" margin="0,0,0,5" maxheight="10" verticalalignment="center"/>             <textbox style="{staticresource mystyle}" text="{binding property, converter={staticresource myconverter}}" verticalalignment="center" fontsize="10" textwrapping="wrap"/>         </stackpanel>     </stackpanel> </datatemplate> 

given this, ways speed things up?


Comments

Popular posts from this blog

c# - Better 64-bit byte array hash -

webrtc - Which ICE candidate am I using and why? -

php - Zend Framework / Skeleton-Application / Composer install issue -