using System.Windows;
using System.Windows.Controls;

namespace AgApp
{
	public class MyPanel : Panel
	{
		public MyPanel()
		{
		}

		protected override System.Windows.Size MeasureOverride(System.Windows.Size availableSize)
		{
			foreach(UIElement element in this.Children)
			{
				element.Measure(availableSize);
			}
			return availableSize;
		}

		protected override System.Windows.Size ArrangeOverride(System.Windows.Size finalSize)
		{
			foreach (UIElement element in this.Children)
			{
				element.Arrange(new Rect( new Point(0,0), finalSize));
			}
			return finalSize;
		}
	}
}
