Created
February 11, 2016 22:36
-
-
Save jassmith/caf44d8e75218067486a to your computer and use it in GitHub Desktop.
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; | |
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