data binding - Image not showing in grid -


in app want display picture inside listbox, linked objects through databinding. however, picture isn't showing reason, , can't seem spot error. know picture in object, because if add new image object xaml, , in code set source 1 of images object, shows it.

below code in steps:

        foreach (indtastning indt in listboxindhold.itemssource)         {             byte[] data = convert.frombase64string(indt.imagename);             stream memstream = new memorystream(data);             writeablebitmap wbimg = picturedecoder.decodejpeg(memstream);             indt.picture = new image();             indt.picture.source = wbimg;             //below test image, shows picture correctly.              testimage.source = indt.picture.source;         } 

my xaml image:

<listbox x:name="listboxindhold" grid.row="0"                        itemssource="{binding .}"                      scrollviewer.verticalscrollbarvisibility="visible"   >             <listbox.itemtemplate>                 <datatemplate >                     <grid horizontalalignment="stretch" verticalalignment="stretch" showgridlines="false">                         <grid.columndefinitions>                             <columndefinition width="auto"/>                             <columndefinition width="*"/>                             <columndefinition width="auto"/>                             <columndefinition width="auto"/>                          </grid.columndefinitions>                          <textblock text="{binding mode=oneway, path=name}" grid.column="0"                                        horizontalalignment="stretch" verticalalignment="center"                                        style="{staticresource phonetextsmallstyle}"                                        textwrapping="wrap" fontsize="24">                                 <toolkit:contextmenuservice.contextmenu>                                     <toolkit:contextmenu>                                         <toolkit:menuitem tag="{binding mode=oneway, path=name}" header="rediger"  click="menuitem_click" />                                         <toolkit:menuitem tag="{binding mode=oneway, path=name}" header="slet"  click="menuitem_click_1"/>                                     </toolkit:contextmenu>                                </toolkit:contextmenuservice.contextmenu>                         </textblock>                          <textblock text="{binding mode=oneway, path=description}" grid.column="1"                                        horizontalalignment="stretch" verticalalignment="center"                                        style="{staticresource phonetextsmallstyle}" textwrapping="wrap"                                         fontsize="24">                                 <toolkit:contextmenuservice.contextmenu>                                     <toolkit:contextmenu>                                         <toolkit:menuitem tag="{binding mode=oneway, path=name}" header="rediger"  click="menuitem_click" />                                         <toolkit:menuitem tag="{binding mode=oneway, path=name}" header="slet"  click="menuitem_click_1"/>                                     </toolkit:contextmenu>                                </toolkit:contextmenuservice.contextmenu>                         </textblock>                          <image source="{binding mode=oneway, path=picture}" grid.column="2" verticalalignment="center" horizontalalignment="center" width="48" height="48" />                          <textblock text="{binding mode=oneway, path=amount}" grid.column="3"                                        horizontalalignment="stretch" verticalalignment="center"                                        style="{staticresource phonetextsmallstyle}"                                        fontsize="24" >                                 <toolkit:contextmenuservice.contextmenu>                                     <toolkit:contextmenu>                                         <toolkit:menuitem tag="{binding mode=oneway, path=name}" header="rediger"  click="menuitem_click" />                                         <toolkit:menuitem tag="{binding mode=oneway, path=name}" header="slet"  click="menuitem_click_1"/>                                     </toolkit:contextmenu>                                </toolkit:contextmenuservice.contextmenu>                         </textblock>                      </grid>                 </datatemplate>             </listbox.itemtemplate>         </listbox> 

my indtastning class:

[datacontract] public class indtastning {     [datamember]     public string name { get; set; }     [datamember]     public double amount { get; set; }     [datamember]     public string description { get; set; }     [datamember]     public bool owes { get; set; }     [datamember]     public string id { get; set; }     [datamember]     public string imagename;      public image picture;       //constructor     public indtastning(string id , string navn, double beløb, string beskrivelse, bool skylder)     {         this.name = navn;         this.description = beskrivelse;         this.amount = beløb;         this.owes = skylder;         this.id = id;     } } 

can spot i'm doing wrong here? it's anoying it's 1 of last things need sort before launching app.

have saved images content or resource . if image resource not see , set content , try again . hope may help


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -