Browse Source

Removed 'force' parameter from Measure.

pull/387/merge
Steven Kirk 10 years ago
parent
commit
72baba2f0e
  1. 6
      src/Perspex.Layout/ILayoutable.cs
  2. 8
      src/Perspex.Layout/Layoutable.cs

6
src/Perspex.Layout/ILayoutable.cs

@ -87,11 +87,7 @@ namespace Perspex.Layout
/// Carries out a measure of the control. /// Carries out a measure of the control.
/// </summary> /// </summary>
/// <param name="availableSize">The available size for the control.</param> /// <param name="availableSize">The available size for the control.</param>
/// <param name="force"> void Measure(Size availableSize);
/// If true, the control will be measured even if <paramref name="availableSize"/> has not
/// changed from the last measure.
/// </param>
void Measure(Size availableSize, bool force = false);
/// <summary> /// <summary>
/// Arranges the control and its children. /// Arranges the control and its children.

8
src/Perspex.Layout/Layoutable.cs

@ -306,18 +306,14 @@ namespace Perspex.Layout
/// Carries out a measure of the control. /// Carries out a measure of the control.
/// </summary> /// </summary>
/// <param name="availableSize">The available size for the control.</param> /// <param name="availableSize">The available size for the control.</param>
/// <param name="force"> public void Measure(Size availableSize)
/// If true, the control will be measured even if <paramref name="availableSize"/> has not
/// changed from the last measure.
/// </param>
public void Measure(Size availableSize, bool force = false)
{ {
if (double.IsNaN(availableSize.Width) || double.IsNaN(availableSize.Height)) if (double.IsNaN(availableSize.Width) || double.IsNaN(availableSize.Height))
{ {
throw new InvalidOperationException("Cannot call Measure using a size with NaN values."); throw new InvalidOperationException("Cannot call Measure using a size with NaN values.");
} }
if (force || !IsMeasureValid || _previousMeasure != availableSize) if (!IsMeasureValid || _previousMeasure != availableSize)
{ {
var previousDesiredSize = DesiredSize; var previousDesiredSize = DesiredSize;
var desiredSize = default(Size); var desiredSize = default(Size);

Loading…
Cancel
Save