3

I have a toolkit:WrapPanel showing in my WP7 app, I have 5 items and the first row only has enough space for 3 items, I would like the wrap panel to place 3 items on the first row, followed by the 2 on the second row being centered.

At the moment it looks like this

* * *
* *

but I want the panel to do this

* * *
 * *

Do I have to implement my own panel or are there changes to the toolkit WrapPanel i can make?

Can there even be an option of how many item I would like on a particular row?

1 Answer 1

0

You could just use the standard WrapPanel but size the container to allow space for 5 items and insert a blank placeholder (of the same width as the actual content) after each real element you add.

This will create the offsetting you're after much like the spaces prepresent a placeholder and the asterisks represent actual content in your example.

1
  • sounds like an ugly hack ... but ... the phone has a screen fixed width / height, so this approach isn't that bad.
    – ColinE
    Commented Aug 11, 2011 at 13:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.