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