Created
July 31, 2020 11:41
-
-
Save jfversluis/538d11caf1fe27cc3360e84a19f01931 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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