c# - GridView Binding Shows The parameter is incorrect -


i writing windows phone 8.1 (winrt). have gridview show photos server.

xaml is:

 <grid x:name="photosgrid" >     <gridview       x:name="photosgridview"      itemssource="{binding}"      continuumnavigationtransitioninfo.exitelementcontainer="true"      isitemclickenabled="true"      itemtemplate="{staticresource photositemtemplate}">                    <gridview.itemspanel>                 <itemspaneltemplate>                     <itemswrapgrid orientation="horizontal" />                 </itemspaneltemplate>             </gridview.itemspanel>     </gridview> </grid>   <page.resources>     <datatemplate x:name="photositemtemplate">         <itemspaneltemplate>             <grid>                     <image source="{binding path=photo}"                                                   imagefailed="photo_imagefailed"                      >                      </image>             </grid>         </itemspaneltemplate>     </datatemplate> </page.resources> 

class is:

 public class photo     {         public string photo { get; set; }     } 

c#:

observablecollection<photo> photoslist = new observablecollection<photo>(); int = 0; foreach(var photos in myprofileresultobject.photos )     {     photoslist.add(new photo { photo = myprofileresultobject.photos[i].photo});     i++;     }                                     photosgridview.itemssource = photoslist; 

but getting error:

{system.argumentexception: parameter incorrect.

the parameter incorrect. }

        unhandledexception += (sender, e) =>         {             if (global::system.diagnostics.debugger.isattached) global::system.diagnostics.debugger.break();         }; 

<gridview.itemtemplate>     <datatemplate>         <image source="{binding path=photo}"         imagefailed="photo_imagefailed" >         </image>     </datatemplate> </gridview.itemtemplate>   

Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -