c# - Want Images as PanoramaItems in WP7? -


i have panorama control need programmaticaly add items images. want implement them flicking on image slide second image , on.. did add images panaroma item shows 1 image only.

 (int = 0; < 10; i++)  {      image_new = new image();      panoramaitem pi = new panoramaitem();       image_new.source = "some image bitmap";      pi.content = image_new;       image_panaroma.items.add(pi);  } 

xaml layout :

<grid x:name="layoutroot">     <controls:panorama name="image_panaroma">     </controls:panorama> </grid> 

can tell me wrong?

also there other way possible give sliding transition images?

you don't exception get, think better approach create itemtemplate panorama control , bind list of objects.

public class itemdata {     public string name { get; set; }     public string path { get; set; } }  ...  list<itemdata> items = new list<itemdata>(10); (int = 0; < 10; i++) {     items.add(new itemdata { name = "something", path = "image path" }); }  this.image_panorama.itemssource = items; 

your xaml this:

<controls:panorama x:name="image_panorama">     <controls:panorama.headertemplate>         <datatemplate>             <textblock text="{binding name}" />         </datatemplate>     </controls:panorama.headertemplate>     <controls:panorama.itemtemplate>         <datatemplate>             <image source="{binding path}" />         </datatemplate>     </controls:panorama.itemtemplate> </controls:panorama>

Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -