Search code examples
imagewindows-phone-7listboxcontrolsdatatemplate

MultiImage WindowsPhone7 Control


I am asking about a wp7 control, which presents an image. I don't know how to do this, and havn't found this in internet. So i need a control, which has different datatemplate depending on count of images needed to present. So, if we need present one image - it will fully show it on full control's size. If there are 2, 3 or 4 images - they must look like in a grid. So their size = size of control / 4.

Examples:
ImageSource has only one Image Item enter image description here

ImageSource has four Image Items enter image description here

Thanks for advices.

I thought to create usercontrol wich is inherit from ListBox, but i don't know how to realize the question.


Solution

  • You should write custom panel, this will be the best way for you. Custom panel will give you speed and flexibility, and implementing it takes 1-2 hours. See example here: http://blogs.msdn.com/b/silverlight_sdk/archive/2008/04/03/creating-a-custom-panel.aspx