Browse Source
To follow WPF. Also removed force parameter from Arrange and fixed Decorator measure invalidation.pull/387/merge
6 changed files with 41 additions and 14 deletions
@ -0,0 +1,33 @@ |
|||||
|
// Copyright (c) The Perspex Project. All rights reserved.
|
||||
|
// Licensed under the MIT license. See licence.md file in the project root for full license information.
|
||||
|
|
||||
|
using Perspex.Controls; |
||||
|
using Xunit; |
||||
|
|
||||
|
namespace Perspex.Layout.UnitTests |
||||
|
{ |
||||
|
public class ArrangeTests |
||||
|
{ |
||||
|
[Fact] |
||||
|
public void Arrange_With_IsMeasureValid_False_Calls_Measure() |
||||
|
{ |
||||
|
var target = new TestControl(); |
||||
|
|
||||
|
Assert.False(target.IsMeasureValid); |
||||
|
target.Arrange(new Rect(0, 0, 120, 120)); |
||||
|
Assert.True(target.IsMeasureValid); |
||||
|
Assert.Equal(new Size(120, 120), target.MeasureConstraint); |
||||
|
} |
||||
|
|
||||
|
private class TestControl : Border |
||||
|
{ |
||||
|
public Size MeasureConstraint { get; private set; } |
||||
|
|
||||
|
protected override Size MeasureOverride(Size constraint) |
||||
|
{ |
||||
|
MeasureConstraint = constraint; |
||||
|
return base.MeasureOverride(constraint); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue