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
31 lines
676 B
C#
31 lines
676 B
C#
namespace OpenMauiXamlApp;
|
|
|
|
public partial class MainPage : ContentPage
|
|
{
|
|
private int _count = 0;
|
|
|
|
public MainPage()
|
|
{
|
|
InitializeComponent();
|
|
|
|
// Wire up slider value changed
|
|
VolumeSlider.ValueChanged += OnVolumeChanged;
|
|
}
|
|
|
|
private void OnCounterClicked(object sender, EventArgs e)
|
|
{
|
|
_count++;
|
|
|
|
CounterBtn.Text = _count == 1
|
|
? $"Clicked {_count} time"
|
|
: $"Clicked {_count} times";
|
|
|
|
SemanticScreenReader.Announce(CounterBtn.Text);
|
|
}
|
|
|
|
private void OnVolumeChanged(object? sender, ValueChangedEventArgs e)
|
|
{
|
|
VolumeLabel.Text = $"Volume: {e.NewValue:F0}";
|
|
}
|
|
}
|