0
votes

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.

2

2 Answers

0
votes

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

0
votes

A wrappanel should work, check the wp7 toolkit on codeplex, it contains such control. If you add all the images to that control and set there "Stretch" property to "Fill", I assume it should work.

untested

Previous failed, as far as I know, you'll have to write something yourself. I haven't encountered such control yet.