Inspired by this article on Codeproject I decided to give reproduce the wrappanel so I could learn a little more about custom panels in SilverLight 2.0 beta 1. The code provided by Inear has some small problems, one of it not being able to behave properly in a scrollviewer. I made some small adjustments after scourging the internet and here is my solution:
Just before you pass on the ArrangeOverride to the base class, inject this code fragment:
[code:c#]
if (this.Height != startPoint.Y + largestHeight)
{
this.SetValue(HeightProperty, startPoint.Y + largestHeight);
}
I did make some other small modifications to clean up the code a bit, and I didn't implement the Orientation=Vertical stuff, but check below for the full code.
WrapPanel.zip (1,11 kb)
Be the first to rate this post
- Currently 0/5 Stars.
- 1
- 2
- 3
- 4
- 5