Skip to content

Instantly share code, notes, and snippets.

@jassmith
Created Feb 11, 2016
Embed
What would you like to do?
using System;
using Windows.Foundation;
using Windows.UI.Xaml.Controls;
namespace MeasureScrewsArrange
{
public class FUPanel : Panel
{
public FUPanel ()
{
for (int i = 0; i < 10; i++) {
Children.Add (new Button {Content = i.ToString ()});
}
}
protected override Size ArrangeOverride (Size finalSize)
{
int x = 10;
foreach (var child in Children) {
child.Arrange (new Rect (x, 0, 100, 100));
x += 110;
}
return base.ArrangeOverride (finalSize);
}
protected override Size MeasureOverride (Size availableSize)
{
return new Size (Children.Count*110 + 10, 100);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment