diff options
Diffstat (limited to 'Software/Visual_Studio/Tango.SharedUI/Controls/TableGrid.cs')
| -rw-r--r-- | Software/Visual_Studio/Tango.SharedUI/Controls/TableGrid.cs | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/Software/Visual_Studio/Tango.SharedUI/Controls/TableGrid.cs b/Software/Visual_Studio/Tango.SharedUI/Controls/TableGrid.cs index 084df75ac..0987e2445 100644 --- a/Software/Visual_Studio/Tango.SharedUI/Controls/TableGrid.cs +++ b/Software/Visual_Studio/Tango.SharedUI/Controls/TableGrid.cs @@ -20,6 +20,19 @@ namespace Tango.SharedUI.Controls DependencyProperty.Register("RowHeight", typeof(GridLength), typeof(TableGrid), new FrameworkPropertyMetadata(new GridLength(1, GridUnitType.Star), FrameworkPropertyMetadataOptions.AffectsRender)); + + public Thickness SecondRowMargin + { + get { return (Thickness)GetValue(SecondRowMarginProperty); } + set { SetValue(SecondRowMarginProperty, value); } + } + + // Using a DependencyProperty as the backing store for SecondRowMargin. This enables animation, styling, binding, etc... + public static readonly DependencyProperty SecondRowMarginProperty = + DependencyProperty.Register("SecondRowMargin", typeof(Thickness), typeof(TableGrid), new PropertyMetadata(new Thickness(20, 0, 0, 0))); + + + public TableGrid() { ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Auto) }); @@ -27,11 +40,6 @@ namespace Tango.SharedUI.Controls this.Loaded += TableGrid_Loaded; } - protected override void OnRender(DrawingContext dc) - { - base.OnRender(dc); - } - private void TableGrid_Loaded(object sender, RoutedEventArgs e) { InvalidateGrid(); @@ -62,7 +70,10 @@ namespace Tango.SharedUI.Controls if (i % 2 != 0) { SetColumn(Children[i], 1); - (Children[i] as FrameworkElement).Margin = new Thickness(20, 0, 0, 0); + if ((Children[i] as FrameworkElement).Margin == new Thickness()) + { + (Children[i] as FrameworkElement).Margin = SecondRowMargin; + } currentRow++; RowDefinitions.Add(new RowDefinition() { Height = RowHeight }); } |
