Skip to content

Instantly share code, notes, and snippets.

@jtheisen
Created January 11, 2014 23:36
Show Gist options
  • Save jtheisen/8378426 to your computer and use it in GitHub Desktop.
Save jtheisen/8378426 to your computer and use it in GitHub Desktop.
A panel that passes size recommendations to, but not from, children.
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