Skip to content

Instantly share code, notes, and snippets.

@jassmith
Created February 11, 2016 22:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jassmith/caf44d8e75218067486a to your computer and use it in GitHub Desktop.
Save jassmith/caf44d8e75218067486a to your computer and use it in GitHub Desktop.
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