Skip to content

Instantly share code, notes, and snippets.

@peterfoot
Created July 14, 2024 15:18
Show Gist options
  • Save peterfoot/8c9c6c49741a77a56af3509227ef5035 to your computer and use it in GitHub Desktop.
Save peterfoot/8c9c6c49741a77a56af3509227ef5035 to your computer and use it in GitHub Desktop.
Frames versus Borders in .NET MAUI
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="MauiBorders.MainPage">
<Grid Padding="16"
RowDefinitions="60,60,60,60,60"
ColumnDefinitions="*,*"
ColumnSpacing="16"
RowSpacing="16">
<Frame Grid.Row="0" Grid.Column="0" BackgroundColor="LightGray">
<Label Text="" HorizontalTextAlignment="Center" VerticalTextAlignment="Center"/>
</Frame>
<Border Grid.Row="0" Grid.Column="1" BackgroundColor="LightGray" StrokeShape="RoundRectangle, 8">
<Label Text="" HorizontalTextAlignment="Center" VerticalTextAlignment="Center"/>
</Border>
<Frame Grid.Row="1" Grid.Column="0" BackgroundColor="LightGray" HasShadow="False">
<Label Text="HasShadow=False" HorizontalTextAlignment="Center" VerticalTextAlignment="Center"/>
</Frame>
<Border Grid.Row="1" Grid.Column="1" BackgroundColor="LightGray" StrokeShape="RoundRectangle, 8">
<Label Text="HasShadow=False" HorizontalTextAlignment="Center" VerticalTextAlignment="Center"/>
</Border>
<Frame Grid.Row="2" Grid.Column="0" BackgroundColor="LightGray" HasShadow="True">
<Label Text="HasShadow=True" HorizontalTextAlignment="Center" VerticalTextAlignment="Center"/>
</Frame>
<Border Grid.Row="2" Grid.Column="1" BackgroundColor="LightGray" StrokeShape="RoundRectangle, 8">
<Border.Shadow>
<Shadow Radius="5"/>
</Border.Shadow>
<Label Text="HasShadow=True" HorizontalTextAlignment="Center" VerticalTextAlignment="Center"/>
</Border>
<Frame Grid.Row="3" Grid.Column="0" BackgroundColor="LightGray" HasShadow="True" CornerRadius="16">
<Label Text="CornerRadius=16" HorizontalTextAlignment="Center" VerticalTextAlignment="Center"/>
</Frame>
<Border Grid.Row="3" Grid.Column="1" BackgroundColor="LightGray" StrokeShape="RoundRectangle, 16">
<Border.Shadow>
<Shadow Radius="5"/>
</Border.Shadow>
<Label Text="CornerRadius=16" HorizontalTextAlignment="Center" VerticalTextAlignment="Center"/>
</Border>
<Frame Grid.Row="4" Grid.Column="0" BackgroundColor="LightGray" BorderColor="Black" HasShadow="True" CornerRadius="16">
<Label Text="BorderColor=Black" HorizontalTextAlignment="Center" VerticalTextAlignment="Center"/>
</Frame>
<Border Grid.Row="4" Grid.Column="1" BackgroundColor="LightGray" Stroke="Black" StrokeThickness="1" StrokeShape="RoundRectangle, 16">
<Border.Shadow>
<Shadow Radius="5"/>
</Border.Shadow>
<Label Text="BorderColor=Black" HorizontalTextAlignment="Center" VerticalTextAlignment="Center"/>
</Border>
</Grid>
</ContentPage>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment