This file contains hidden or 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
{ | |
"page": { | |
"type": "ContentPage", | |
"properties": { | |
"title": "Login Page", | |
"background": "linear-gradient(#e3f2fd, #bbdefb)" | |
}, | |
"children": [ | |
{ | |
"type": "VerticalStackLayout", |
This file contains hidden or 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
<?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="MyApp.LoginPage"> | |
<ContentPage.Background> | |
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1"> | |
<GradientStop Color="#e3f2fd" Offset="0.0"/> | |
<GradientStop Color="#bbdefb" Offset="1.0"/> | |
</LinearGradientBrush> | |
</ContentPage.Background> |
This file contains hidden or 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
page LoginPage { | |
background: gradient(linear, #e3f2fd, #bbdefb) | |
layout: VerticalStackLayout { | |
spacing: 20 | |
padding: 30 | |
vertical-options: center | |
children: [ | |
Image { | |
source: "logo.png" | |
height-request: 100 |
This file contains hidden or 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
screen WelcomeScreen { | |
layout: VerticalStack { | |
padding: 20 | |
children: [ | |
Text { | |
value: "Hello, World!" | |
font-size: 24 | |
is-bold: true | |
}, | |
Button { |
This file contains hidden or 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
UI.Build() | |
.StackLayout(Orientation.Vertical) | |
.Label("Hello, World!").FontSize(24).Bold().End() | |
.Button("Click Me").OnClick(ButtonClicked).Primary().End() | |
.End(); |
This file contains hidden or 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
public class AnimatePathAction : TriggerAction<VisualElement> | |
{ | |
protected override async void Invoke(VisualElement sender) | |
{ | |
if (sender is Path path) | |
{ | |
// Calculate the approximate length of the path (this can be complex for real apps) | |
double pathLength = 1000; | |
path.StrokeDashArray = new DoubleCollection { pathLength, pathLength }; |
This file contains hidden or 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
<Path x:Name="AnimatedPath" | |
Stroke="Blue" | |
StrokeThickness="3" | |
Fill="Transparent" | |
Data="M 10,50 C 100,0 200,100 290,50"> | |
<Path.Triggers> | |
<EventTrigger Event="Loaded"> | |
<EventTrigger.Actions> | |
<local:AnimatePathAction /> | |
</EventTrigger.Actions> |
This file contains hidden or 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
<Path Fill="#FF8030" Stroke="Black" | |
Data="M 50,10 L 70,40 L 90,50 L 70,60 L 50,90 L 30,60 L 10,50 L 30,40 Z M 50,30 A 5,5 0 1 1 50,30.1 Z" /> | |
<Path Fill="White" | |
Data="M 40,45 A 3,3 0 1 1 40,45.1 Z M 60,45 A 3,3 0 1 1 60,45.1 Z" /> |
This file contains hidden or 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
<Path Stroke="Green" | |
StrokeThickness="3" | |
HorizontalOptions="Center" | |
VerticalOptions="Center" | |
Data="M 10,30 L 25,45 L 60,10" /> |
This file contains hidden or 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
<!-- A wavy divider at the bottom of a layout --> | |
<BoxView Color="LightBlue" HeightRequest="20"/> | |
<Path Fill="LightBlue" | |
Data="M0,0 L0,20 C100,0 200,40 300,20 L300,0 Z" | |
HorizontalOptions="Fill"/> |