本文整理汇总了C#中System.Windows.Size.GoldenSize方法的典型用法代码示例。如果您正苦于以下问题:C# Size.GoldenSize方法的具体用法?C# Size.GoldenSize怎么用?C# Size.GoldenSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Size
的用法示例。
在下文中一共展示了Size.GoldenSize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MeasureOverride
protected override Size MeasureOverride(Size availableSize)
{
Size adjustedSize = new Size(availableSize.Width - 15, availableSize.Height);
Size cardSize = adjustedSize.GoldenSize(4, Orientation.Horizontal);
foreach (UIElement child in InternalChildren)
child.Measure(cardSize);
return new Size((cardSize.Width * 4) + 15, cardSize.Height);
}
示例2: ArrangeOverride
protected override Size ArrangeOverride(Size finalSize)
{
Size adjustedSize = new Size(finalSize.Width - 15, finalSize.Height);
Size cardSize = adjustedSize.GoldenSize(4, Orientation.Horizontal);
foreach (UIElement child in InternalChildren.OfType<PilePlaceHolder>())
{
child.Arrange(new Rect(new Point(0, 0), cardSize));
}
double x = cardSize.Width + 15;
foreach (UIElement child in InternalChildren.OfType<UIElement>().Where(c => !(c is PilePlaceHolder)))
{
child.Arrange(new Rect(x, 0, cardSize.Width, cardSize.Height));
x += cardSize.Width;
}
return new Size((cardSize.Width * 4) + 15, cardSize.Height);
}