controls - Container inside Datatemplate inside Listbox is null when list is too long -


i have listbox contains datatemplate image , textblock control inside. want imagecontrol out first getting grid container

<listbox x:name="newslist" margin="0,0,20,0" selectionchanged="newslist_selectionchanged" />     <datatemplate>             <grid width="400" height="89">             <image horizontalalignment="left" width="64" x:name="imagethumbnail" height="64" verticalalignment="top" margin="0,10,0,0" source="http://vnexpress.net/files/subject/3b/a2/3b/15/top.jpg"/>                 <textblock text="{binding title}" margin="78,0,8,0" textwrapping="wrap" fontsize="26.667" height="74" verticalalignment="top"/>             </grid>         </datatemplate> </listbox> (int = 0; < feeds.count; i++)     var containeritem = list.itemcontainergenerator.containerfromindex(i); 

and when set newslist.items = feeds feeds.count more 23, of containeritem null. if less 23, never null container.

does know cause , how can fix it. if can have way imagecontrol out

one thing can see xaml doesn't right me.

shouldn't this:

<listbox x:name="newslist" margin="0,0,20,0" selectionchanged="newslist_selectionchanged">   <listbox.itemtemplate>     <datatemplate>         <grid width="400" height="89">         <image horizontalalignment="left" width="64" x:name="imagethumbnail" height="64" verticalalignment="top" margin="0,10,0,0" source="http://vnexpress.net/files/subject/3b/a2/3b/15/top.jpg"/>             <textblock text="{binding title}" margin="78,0,8,0" textwrapping="wrap" fontsize="26.667" height="74" verticalalignment="top"/>         </grid>     </datatemplate>   </listbox.itemtemplate> </listbox> 

beyond i'm not sure if totally or not.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -