Skip to content

Commit

Permalink
[.NET] Fix separator location for elements (microsoft#3157)
Browse files Browse the repository at this point in the history
* Fix separators

* Fix separator again for making one element
  • Loading branch information
almedina-ms committed Jul 16, 2019
1 parent 670fbfb commit 5c11148
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,13 @@ public static Grid AddSeparator(AdaptiveRenderContext context, AdaptiveElement e

SeparatorConfig sepStyle = context.Config.Separator;

uiSep.Margin = new Thickness(0, (spacing - sepStyle.LineThickness) / 2, 0, 0);
var margin = (spacing - sepStyle.LineThickness) / 2;
uiSep.Margin = new Thickness(0, margin, 0, margin);
uiSep.SetHeight(sepStyle.LineThickness);
if (!string.IsNullOrWhiteSpace(sepStyle.LineColor))
uiSep.SetBackgroundColor(sepStyle.LineColor,context);
{
uiSep.SetBackgroundColor(sepStyle.LineColor, context);
}
uiContainer.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
Grid.SetRow(uiSep, uiContainer.RowDefinitions.Count - 1);
uiContainer.Children.Add(uiSep);
Expand Down

0 comments on commit 5c11148

Please sign in to comment.