From cda2e6fb9c2f6e92e3800a8d21a2691f5744bb6b Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Wed, 20 Jun 2018 16:24:10 +0300 Subject: Working on PPC... --- .../Tango.SharedUI/Controls/TableGrid.cs | 23 ++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'Software/Visual_Studio/Tango.SharedUI') 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 }); } -- cgit v1.3.1