windows phone 8 - LongListSelector with items of variable height & content -


i've used , familiar longlistselector having specific item template items listed.

now try implement more complex longlistselector items added not of fixed height/specific content. couple of textblocks , images in 1 case , 2 times same elements in (it's set of elements appears 1,2 or 3 times per item).

note: use observablecollection connect longlistselector.

observablecollection<routeinformation> routes = new observablecollection<routeinformation>();          public routepage()         {             initializecomponent();              routeslonglistselector.itemssource = routes;         } 

and populate list pulling data database , in end adding them with

routes.add(new routeinformation(..., ...)); 

any suggestions?

define multiple item templates in page's resources:

<phone:phoneapplicationpage.resources>     <datatemplate x:key="itemtemplate3line">... </phone:phoneapplicationpage.resources>  <longlistselector x:name="lls"> 

and in code behind depending on condition, select custom data template:

 if (...)     lls.itemtemplate = resources["itemtemplate3line"] datatemplate; 

Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -