Improve the XAML Editor

This commit is contained in:
Frank A. Krueger 2017-12-10 20:17:35 -08:00
parent 0598645923
commit 9d50826c18
2 changed files with 15 additions and 6 deletions

View File

@ -3,6 +3,7 @@
<ContentPage.Content>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
@ -10,8 +11,12 @@
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Editor x:Name="editor" FontFamily="monospace" Grid.Row="0" Grid.Column="0" />
<ContentView x:Name="results" Grid.Row="0" Grid.Column="1" BackgroundColor="White" />
<StackLayout Orientation="Vertical" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2">
<Label Text="Xamarin.Forms XAML Editor" FontSize="24" FontAttributes="Bold" Margin="8,8,8,0" />
<Label Text="Edit the XAML below to see a live preview on the right" Margin="8,0,8,8" />
</StackLayout>
<Editor x:Name="editor" FontFamily="monospace" FontSize="12" Grid.Row="1" Grid.Column="0" />
<ContentView x:Name="results" Grid.Row="1" Grid.Column="1" BackgroundColor="White" />
</Grid>
</ContentPage.Content>
</ContentPage>

View File

@ -23,10 +23,14 @@ namespace Samples
<ColumnDefinition Width=""*"" />
<ColumnDefinition Width=""*"" />
</Grid.ColumnDefinitions>
<Label Text=""Top Left"" Grid.Row=""0"" Grid.Column=""0"" />
<Label Text=""Top Right"" Grid.Row=""0"" Grid.Column=""1"" />
<Label Text=""Bottom Left"" Grid.Row=""1"" Grid.Column=""0"" />
<Label Text=""Bottom Right"" Grid.Row=""1"" Grid.Column=""1"" />
<StackLayout Grid.Row=""0"" Grid.Column=""0"">
<Label Text=""Top Left"" />
<Entry Placeholder=""I'm ready for some text"" />
<Button Text=""I'm a button, but I don't do anything"" />
</StackLayout>
<Label Text=""Top Right"" Grid.Row=""0"" Grid.Column=""1"" TextColor=""White"" BackgroundColor=""#c5000b"" />
<Label Text=""Bottom Left"" Grid.Row=""1"" Grid.Column=""0"" TextColor=""Black"" BackgroundColor=""#ffd320"" />
<Label Text=""Bottom Right"" Grid.Row=""1"" Grid.Column=""1"" TextColor=""White"" BackgroundColor=""#008000"" />
</Grid>
</ContentView>";
editor.TextChanged += (sender, e) => DisplayXaml ();