Silverlight 2.0 Modified WrapPanel

by Rob 3. June 2008 19:18

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:

C# | Silverlight

Comments

7/4/2008 11:32:27 AM

trackback

Trackback from Infosys | Microsoft

Silverlight - Animating Wrap Panel

Infosys | Microsoft

7/31/2008 8:44:41 PM

pingback

Pingback from mark.mymonster.nl

Creating a Silverlight TagCloud UserControl » Mark Monster

mark.mymonster.nl

Powered by BlogEngine.NET 1.4.0.0
Theme by Mads Kristensen

About the author

Some text that describes me

Recent comments

Comment RSS

Page List

    Disclaimer

    The opinions expressed herein are my own personal opinions and do not represent my employer's view in  anyway.

    © Copyright 2008