diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-06-20 16:24:10 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-06-20 16:24:10 +0300 |
| commit | cda2e6fb9c2f6e92e3800a8d21a2691f5744bb6b (patch) | |
| tree | b791635c0030f5e9a41d7eacd3388b2aee685f50 /Software/Visual_Studio/Tango.SharedUI/Controls/TableGrid.cs | |
| parent | bc5b579516e8b770338ff2924cc2215d1f46da2d (diff) | |
| download | Tango-cda2e6fb9c2f6e92e3800a8d21a2691f5744bb6b.tar.gz Tango-cda2e6fb9c2f6e92e3800a8d21a2691f5744bb6b.zip | |
Working on PPC...
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 }); } |
