C# Windows Phone: Is it possible to fill LongListSelector with images? -
i fill longlistselector names of products , put images of products in longlistselector. datas webserver using webclient method. image know should use this:
pic.source = new system.windows.media.imaging.bitmapimage(new uri("http://srvname.com/images/greenpasta.jpg"));
but don't know how show images on long list selector.
you should keep url of image attribute product, not image source itself. can have like
myproduct.uri = new uri("http://srvname.com/images/greenpasta.jpg")
and in xaml:
<datatemplate> <grid> <grid.columndefinition> <columndefinition witdh="100" \> <columndefinition witdh="auto" \> <columndefinition witdh="*" \> </grid.columndefinition> <image source="{binding uri}" height="100" stretch="fill"/> > <textblock text="{binding name}" /> > </grid> </datatemplate>
just suggestion, replacing stackpanel grid, can reserve space image (100 pixels), downloaded async. otherwise, when image apear on screen, move other content.
Comments
Post a Comment