diff options
Diffstat (limited to 'Xamarin.Forms.Core/RowDefinition.cs')
-rw-r--r-- | Xamarin.Forms.Core/RowDefinition.cs | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/Xamarin.Forms.Core/RowDefinition.cs b/Xamarin.Forms.Core/RowDefinition.cs new file mode 100644 index 00000000..746332ea --- /dev/null +++ b/Xamarin.Forms.Core/RowDefinition.cs @@ -0,0 +1,34 @@ +using System; + +namespace Xamarin.Forms +{ + public sealed class RowDefinition : BindableObject, IDefinition + { + public static readonly BindableProperty HeightProperty = BindableProperty.Create("Height", typeof(GridLength), typeof(RowDefinition), new GridLength(1, GridUnitType.Star), + propertyChanged: (bindable, oldValue, newValue) => ((RowDefinition)bindable).OnSizeChanged()); + + public RowDefinition() + { + MinimumHeight = -1; + } + + public GridLength Height + { + get { return (GridLength)GetValue(HeightProperty); } + set { SetValue(HeightProperty, value); } + } + + internal double ActualHeight { get; set; } + + internal double MinimumHeight { get; set; } + + public event EventHandler SizeChanged; + + void OnSizeChanged() + { + EventHandler eh = SizeChanged; + if (eh != null) + eh(this, EventArgs.Empty); + } + } +}
\ No newline at end of file |