// -----------------------------------------------------------------------
//
// Copyright 2015 MIT Licence. See licence.md for more information.
//
// -----------------------------------------------------------------------
namespace Perspex.Controls
{
///
/// Holds a row definitions for a .
///
public class RowDefinition : DefinitionBase
{
///
/// Defines the property.
///
public static readonly PerspexProperty MaxHeightProperty =
PerspexProperty.Register("MaxHeight", double.PositiveInfinity);
///
/// Defines the property.
///
public static readonly PerspexProperty MinHeightProperty =
PerspexProperty.Register("MinHeight");
///
/// Defines the property.
///
public static readonly PerspexProperty HeightProperty =
PerspexProperty.Register("Height", new GridLength(1, GridUnitType.Star));
///
/// Initializes a new instance of the class.
///
public RowDefinition()
{
}
///
/// Initializes a new instance of the class.
///
/// The height of the row.
/// The height unit of the column.
public RowDefinition(double value, GridUnitType type)
{
this.Height = new GridLength(value, type);
}
///
/// Initializes a new instance of the class.
///
/// The height of the column.
public RowDefinition(GridLength height)
{
this.Height = height;
}
///
/// Gets the actual calculated height of the row.
///
public double ActualHeight
{
get;
internal set;
}
///
/// Gets or sets the maximum height of the row in DIPs.
///
public double MaxHeight
{
get { return this.GetValue(MaxHeightProperty); }
set { this.SetValue(MaxHeightProperty, value); }
}
///
/// Gets or sets the minimum height of the row in DIPs.
///
public double MinHeight
{
get { return this.GetValue(MinHeightProperty); }
set { this.SetValue(MinHeightProperty, value); }
}
///
/// Gets or sets the height of the row.
///
public GridLength Height
{
get { return this.GetValue(HeightProperty); }
set { this.SetValue(HeightProperty, value); }
}
}
}