// -----------------------------------------------------------------------
//
// Copyright 2013 MIT Licence. See licence.md for more information.
//
// -----------------------------------------------------------------------
namespace Perspex.Controls
{
public class ColumnDefinition : DefinitionBase
{
public static readonly PerspexProperty MaxWidthProperty =
PerspexProperty.Register("MaxWidth", double.PositiveInfinity);
public static readonly PerspexProperty MinWidthProperty =
PerspexProperty.Register("MinWidth");
public static readonly PerspexProperty WidthProperty =
PerspexProperty.Register("Width", new GridLength(1, GridUnitType.Star));
public ColumnDefinition()
{
}
public ColumnDefinition(double value, GridUnitType type)
{
this.Width = new GridLength(value, type);
}
public ColumnDefinition(GridLength width)
{
this.Width = width;
}
public double ActualWidth
{
get;
internal set;
}
public double MaxWidth
{
get { return this.GetValue(MaxWidthProperty); }
set { this.SetValue(MaxWidthProperty, value); }
}
public double MinWidth
{
get { return this.GetValue(MinWidthProperty); }
set { this.SetValue(MinWidthProperty, value); }
}
public GridLength Width
{
get { return this.GetValue(WidthProperty); }
set { this.SetValue(WidthProperty, value); }
}
}
}