Created
January 11, 2014 23:36
-
-
Save jtheisen/8378426 to your computer and use it in GitHub Desktop.
A panel that passes size recommendations to, but not from, children.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Windows; | |
using System.Windows.Controls; | |
namespace MonkeyBusters | |
{ | |
public class NannyPanel : Panel | |
{ | |
protected override Size ArrangeOverride(Size finalSize) | |
{ | |
foreach (var child in Children) | |
{ | |
child.Arrange(new Rect(new Point(), finalSize)); | |
child.InvalidateArrange(); | |
} | |
return base.ArrangeOverride(finalSize); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment