I have the following object:
new Grid {
RowDefinitions =
{
new RowDefinition { Height = new GridLength(3, GridUnitType.Star) },
new RowDefinition { Height = new GridLength(2, GridUnitType.Star) },
new RowDefinition { Height = new GridLength(2, GridUnitType.Star) }
},
ColumnDefinitions =
{
new ColumnDefinition { Width = new GridLength(3, GridUnitType.Star) },
new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) }
},
Children =
{
new Label { Text = "TRIP #5", FontFamily = Device.OnPlatform(null, "latoblack.ttf#Lato Black", null), FontSize = 16, TextColor = Color.White, HorizontalTextAlignment = TextAlignment.Start, Margin = new Thickness(0, 0, 0, 10) },
new Label { Text = "Started 24/07/2017", FontFamily = Device.OnPlatform(null, "latolight.ttf#Lato Light", null), FontSize = 16, TextColor = Color.White, HorizontalTextAlignment = TextAlignment.Start },
new Label { Text = "Is currently in progress", FontFamily = Device.OnPlatform(null, "latolight.ttf#Lato Light", null), FontSize = 16, TextColor = Color.White, HorizontalTextAlignment = TextAlignment.Start }
}
}
I want to place the labels in positions (0,0), (0,1), (1,1) without having to use Children.Add. More specifically, I want to set the position of the labels to the positions that I mentioned directly from the object definition. How can I do that?
Thank you in advance!