Thursday, 15 September 2011

silverlight - Windows Phone Binding Images -



silverlight - Windows Phone Binding Images -

this question has reply here:

windows phone image binding 2 answers

is possible bind collection of images , alter canvas.left , canvas.top properties? know how bind them listbox, however, wish alter location , have images scattered about.

the next code sends info listbox , renders images 1 after other in list effect - of course.

i unable utilize canvas.left/top properties images in list box.

xml

<listbox x:name="listboxitems"> <listbox.itemtemplate> <datatemplate> <stackpanel margin="5"> <image source="{binding imageuri}" stretch="none" /> <textblock text="{binding room.items.imageuri}"></textblock> </stackpanel> </datatemplate> </listbox.itemtemplate> </listbox>

c#

_roomview = new roomviewmodel(); _roomview.room = new room { items = new list<item> { new item {imageuri = "/escape;component/images/items/a.jpg"}, new item {imageuri = "/escape;component/images/items/b.png"}, new item {imageuri = "/escape;component/images/items/b.png"}} }; listboxitems.itemssource = _roomview.room.items;

does know how can accomplish this?

if utilize in itemtemplate canvas insteed of stackpanel can utilize attachedproperty: canvas.top/canvas.left on image , on textblock too. can set positions of items wish. hope help you.

silverlight windows-phone-7 listbox windows-phone

No comments:

Post a Comment