Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing Symbol Display sample #606

Merged
merged 10 commits into from
Sep 20, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,14 @@ private void AddSymbol(Symbol symbol)
{
int columnCount = LayoutRoot.ColumnDefinitions.Count;
var sd = new SymbolDisplay() { Symbol = symbol };
Border border = new Border()
{
HorizontalOptions = LayoutOptions.Center,
VerticalOptions = LayoutOptions.Center,
Padding = 0,
StrokeThickness = 1,
};
border.SetAppThemeColor(Microsoft.Maui.Controls.Border.StrokeProperty, Colors.Black, Colors.White);
border.Content = sd;
int count = LayoutRoot.Children.Count;
var row = count / columnCount;
var column = count % columnCount;
if (column == 0)
LayoutRoot.RowDefinitions.Add(new RowDefinition());
Grid.SetRow(border, row);
Grid.SetColumn(border, column);
LayoutRoot.Children.Add(border);
Grid.SetRow(sd, row);
Grid.SetColumn(sd, column);
LayoutRoot.Children.Add(sd);
}
}
}
Loading