Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jfversluis/538d11caf1fe27cc3360e84a19f01931 to your computer and use it in GitHub Desktop.
Save jfversluis/538d11caf1fe27cc3360e84a19f01931 to your computer and use it in GitHub Desktop.
// MainPage.xaml.cs
public RowDefinitionCollection MyRows { get; set; }
public MainPage()
{
InitializeComponent();
// Magic happening here
MyRows = (RowDefinitionCollection)new RowDefinitionCollectionTypeConverter().ConvertFromInvariantString("Auto, 100, *, 50");
BindingContext = this;
}
// MainPage.xaml
<?xml version="1.0" encoding="utf-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="TestSwitch.MainPage">
<Grid RowDefinitions="{Binding MyRows}">
<Frame Grid.Row="0" BackgroundColor="#2196F3" Padding="24" CornerRadius="0">
<Label Text="Welcome to Xamarin.Forms!" HorizontalTextAlignment="Center" TextColor="White" FontSize="36" />
</Frame>
<Label Text="1" Grid.Row="1" />
<Label Text="2" Grid.Row="2" />
<Label Text="3" Grid.Row="3" />
</Grid>
</ContentPage>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment