How to Show Previous page selected item in flip view control in another page in windows 8? -


i want show grid view selected item in flip view control.the control placed in page. please tell me how this?

i tried below code: previous page grid view item click event:

private void photogrid_itemclick(object sender, itemclickeventargs e)         {             var itemid = ((flipimage)e.clickeditem);             flipimage s = new flipimage() { imageurl = itemid.imageurl, title = itemid.title };             this.frame.navigate(typeof(flippage), s);         } 

second page :

 protected override void onnavigatedto(navigationeventargs e)         {             //xdocument xdoc = xdocument.load("xmlfile1.xml");             //ienumerable<flipimage> images = img in xdoc.descendants("image") select new flipimage(img.element("imagetitle").value, img.element("imageurl").value);              flipimage s = (flipimage)e.parameter;            string url =  s.imageurl;            flipviewcontrol.items.add(url);             //flipviewcontrol.datacontext = images;         }    <flipview horizontalalignment="left" verticalalignment="top" x:name="flipviewcontrol" itemssource="{binding}">             <flipview.itemtemplate>                 <datatemplate>                      <image horizontalalignment="left"  source="{binding imageurl}" height="762" verticalalignment="top" width="1360" x:name="imagecontrol"/>                 </datatemplate>             </flipview.itemtemplate>          </flipview> 

please tell me how show previuos page images in flip view page in windows 8?

hey have made standard sample work problem..you binding flipview itemssource images ( collection of strings think in case ..) first make observablecollection named images..like this.in page.cs( or in view model if using in case have send message viewmodel.) this..

 public observablecollection<string> images { get; set; } 

in page constructor this..

public basicpage1()     {         this.initializecomponent();         images = new observablecollection<string>();           this.datacontext = this;     } 

and when navigate page add string url collection automatically update flipview..i have taken predefined string(i think it's fine)

protected override void onnavigatedto(navigationeventargs e)     {         //xdocument xdoc = xdocument.load("xmlfile1.xml");         //ienumerable<flipimage> images = img in xdoc.descendants("image") select new flipimage(img.element("imagetitle").value, img.element("imageurl").value);          string url = "/assets/teacher-symbol.png";         images.add(url);         images.add(url);         images.add(url);         images.add(url);         images.add(url);         images.add(url);       //  flipviewcontrol.items.add(url);          //flipviewcontrol.datacontext = images;     } 

now change flipview control this..

<flipview horizontalalignment="left" verticalalignment="top" x:name="flipviewcontrol" itemssource="{binding images}" grid.row="1">         <flipview.itemtemplate>             <datatemplate>                  <image horizontalalignment="left"  source="{binding}" height="762" verticalalignment="top" width="1360" x:name="imagecontrol"/>             </datatemplate>         </flipview.itemtemplate>      </flipview> 

hope help..for query comment below..

for query..you have this..for other images..

private void flipviewcontrol_selectionchanged(object sender, selectionchangedeventargs e)     {         string url = "/assets/usericondash.png";         images.add(url);     } 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -