Silverlight 2.0 Modified WrapPanel

June 3, 2008 19:18 by Rob

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
Tags:
Categories: C# | Silverlight
Actions: E-mail | Permalink | Comments (2) | Comment RSSRSS comment feed

Comments

trackback

July 4, 2008 11:32

Trackback from Infosys | Microsoft

Silverlight - Animating Wrap Panel

Infosys | Microsoft

pingback

July 31, 2008 20:44

Pingback from mark.mymonster.nl

Creating a Silverlight TagCloud UserControl » Mark Monster

mark.mymonster.nl