Add full XAML support for .NET MAUI compatibility
New features:
- MauiAppBuilderExtensions.UseOpenMauiLinux() for standard MAUI integration
- New template: openmaui-linux-xaml with full XAML support
- Standard MAUI XAML syntax (ContentPage, VerticalStackLayout, etc.)
- Resource dictionaries (Colors.xaml, Styles.xaml)
- Compiled XAML support via MauiXaml items
Templates now available:
- dotnet new openmaui-linux (code-based UI)
- dotnet new openmaui-linux-xaml (XAML-based UI)
Usage:
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.UseOpenMauiLinux(); // Enable Linux with XAML
This commit is contained in:
82
templates/openmaui-linux-xaml-app/MainPage.xaml
Normal file
82
templates/openmaui-linux-xaml-app/MainPage.xaml
Normal file
@@ -0,0 +1,82 @@
|
||||
<?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="OpenMauiXamlApp.MainPage"
|
||||
Title="Home">
|
||||
|
||||
<ScrollView>
|
||||
<VerticalStackLayout
|
||||
Padding="30,0"
|
||||
Spacing="25"
|
||||
VerticalOptions="Center">
|
||||
|
||||
<Image
|
||||
Source="dotnet_bot.png"
|
||||
HeightRequest="185"
|
||||
Aspect="AspectFit"
|
||||
SemanticProperties.Description="dot net bot waving hi to you!" />
|
||||
|
||||
<Label
|
||||
Text="Hello, OpenMaui!"
|
||||
Style="{StaticResource Headline}"
|
||||
SemanticProperties.HeadingLevel="Level1"
|
||||
HorizontalOptions="Center" />
|
||||
|
||||
<Label
|
||||
Text="Welcome to .NET MAUI on Linux"
|
||||
Style="{StaticResource SubHeadline}"
|
||||
SemanticProperties.Description="Welcome to dot net MAUI on Linux"
|
||||
HorizontalOptions="Center" />
|
||||
|
||||
<Button
|
||||
x:Name="CounterBtn"
|
||||
Text="Click me"
|
||||
SemanticProperties.Hint="Counts the number of times you click"
|
||||
Clicked="OnCounterClicked"
|
||||
HorizontalOptions="Fill" />
|
||||
|
||||
<HorizontalStackLayout
|
||||
Spacing="10"
|
||||
HorizontalOptions="Center">
|
||||
|
||||
<CheckBox
|
||||
x:Name="AgreeCheckBox"
|
||||
IsChecked="False" />
|
||||
<Label
|
||||
Text="I agree to the terms"
|
||||
VerticalOptions="Center" />
|
||||
|
||||
</HorizontalStackLayout>
|
||||
|
||||
<Entry
|
||||
x:Name="NameEntry"
|
||||
Placeholder="Enter your name"
|
||||
HorizontalOptions="Fill" />
|
||||
|
||||
<Slider
|
||||
x:Name="VolumeSlider"
|
||||
Minimum="0"
|
||||
Maximum="100"
|
||||
Value="50"
|
||||
HorizontalOptions="Fill" />
|
||||
|
||||
<Label
|
||||
x:Name="VolumeLabel"
|
||||
Text="Volume: 50"
|
||||
HorizontalOptions="Center" />
|
||||
|
||||
<Switch
|
||||
x:Name="DarkModeSwitch"
|
||||
IsToggled="False"
|
||||
HorizontalOptions="Center" />
|
||||
|
||||
<ProgressBar
|
||||
x:Name="LoadingProgress"
|
||||
Progress="0.5"
|
||||
ProgressColor="{StaticResource Primary}"
|
||||
HorizontalOptions="Fill" />
|
||||
|
||||
</VerticalStackLayout>
|
||||
</ScrollView>
|
||||
|
||||
</ContentPage>
|
||||
Reference in New Issue
Block a user