|
4 | 4 | xmlns:stroked="https://vapolia.eu/Vapolia.StrokedLabel"
|
5 | 5 | x:Class="SampleApp.Views.MainPage"
|
6 | 6 | Title="Stroked Labels Demo">
|
| 7 | + <Page.Resources> |
| 8 | + <Style TargetType="Label"> |
| 9 | + <Setter Property="TextColor" Value="LightBlue" /> |
| 10 | + <Setter Property="stroked:StrokedLabel.StrokeColor" Value="DarkBlue" /> |
| 11 | + <Setter Property="stroked:StrokedLabel.StrokeWidth" Value="4" /> |
| 12 | + </Style> |
| 13 | + </Page.Resources> |
7 | 14 |
|
8 | 15 | <ScrollView>
|
9 |
| - <Grid RowDefinitions="*,40"> |
10 |
| - |
11 |
| - <StackLayout Padding="30" Spacing="25"> |
12 |
| - <StackLayout.Resources> |
13 |
| - <Style TargetType="Label"> |
14 |
| - <Setter Property="stroked:StrokedLabel.StrokeColor" Value="Blue" /> |
15 |
| - <Setter Property="stroked:StrokedLabel.StrokeWidth" Value="4" /> |
16 |
| - </Style> |
17 |
| - </StackLayout.Resources> |
| 16 | + <StackLayout Padding="30" Spacing="25"> |
18 | 17 |
|
19 |
| - <Label FontSize="32" HorizontalOptions="Center" |
20 |
| - Style="{StaticResource MauiLabel}" |
21 |
| - stroked:StrokedLabel.StrokeColor="Blue" |
22 |
| - stroked:StrokedLabel.StrokeWidth="4" |
23 |
| - Text="Hello, World!" /> |
| 18 | + <Label FontSize="32" |
| 19 | + HorizontalOptions="Center" |
| 20 | + Text="I like stoked labels!" /> |
24 | 21 |
|
25 |
| - <Label FontSize="18" HorizontalOptions="Center" |
26 |
| - Style="{StaticResource MauiLabel}" |
27 |
| - stroked:StrokedLabel.StrokeColor="Green" |
28 |
| - stroked:StrokedLabel.StrokeWidth="4" |
29 |
| - Text="Welcome to .NET Multi-platform App UI" /> |
| 22 | + <Grid> |
| 23 | + <Image Source="sakura.jpg" Aspect="AspectFit" /> |
| 24 | + |
| 25 | + <Label FontSize="40" |
| 26 | + HorizontalTextAlignment="Center" |
| 27 | + VerticalOptions="Center" |
| 28 | + TextColor="Aquamarine" |
| 29 | + stroked:StrokedLabel.StrokeColor="Black" |
| 30 | + stroked:StrokedLabel.StrokeWidth="4" |
| 31 | + Text="Stroked text is much more readable when over a background image" /> |
| 32 | + </Grid> |
30 | 33 |
|
31 |
| - <Label x:Name="CounterLabel" FontAttributes="Bold" FontSize="18" HorizontalOptions="Center" |
32 |
| - Style="{StaticResource MauiLabel}" |
33 |
| - Text="Current count: 0" /> |
| 34 | + <Label FontSize="20" |
| 35 | + HorizontalTextAlignment="Center" |
| 36 | + TextColor="DarkRed" |
| 37 | + stroked:StrokedLabel.StrokeColor="Red" |
| 38 | + stroked:StrokedLabel.StrokeWidth="1" |
| 39 | + Text="Stroked text can be emphasized without needing bold" /> |
34 | 40 |
|
35 |
| - </StackLayout> |
| 41 | + <Label FontSize="24" |
| 42 | + HorizontalTextAlignment="Center" |
| 43 | + TextColor="LightGoldenrodYellow" |
| 44 | + stroked:StrokedLabel.StrokeColor="LightCoral" |
| 45 | + stroked:StrokedLabel.StrokeWidth="1" |
| 46 | + Text="It can also glow with a shadow!"> |
| 47 | + <Label.Shadow> |
| 48 | + <Shadow Brush="Red" |
| 49 | + Offset="0,0" |
| 50 | + Radius="2" |
| 51 | + Opacity="0.8" /> |
| 52 | + </Label.Shadow> |
| 53 | + </Label> |
36 | 54 |
|
37 |
| - <Grid Grid.Row="1" BackgroundColor="{AppThemeBinding Dark={StaticResource BackgroundDark}, Light={StaticResource Primary}}"> |
38 |
| - <Label x:Name="VersionLabel" HorizontalOptions="Center" VerticalOptions="Center" |
39 |
| - TextColor="{StaticResource White}" /> |
40 |
| - </Grid> |
41 |
| - |
42 |
| - </Grid> |
| 55 | + </StackLayout> |
43 | 56 | </ScrollView>
|
44 | 57 |
|
45 | 58 | </ContentPage>
|
0 commit comments