Files
logikonline ae5c9ab738 Add Visual Studio extension for Linux platform support
VSIX extension that adds:
- "OpenMaui Linux App" project template in File → New → Project
- Pre-configured launch profiles for Linux debugging
- WSL integration for Windows developers
- x64 and ARM64 build configurations

Launch Profiles included:
- Linux (Local) - Direct execution
- Linux (WSL) - Run via WSL
- Linux (x64 Release) - Release build for x64
- Linux (ARM64 Release) - Release build for ARM64
- Publish Linux x64/ARM64 - Self-contained publishing

Build with: msbuild /p:Configuration=Release
Output: OpenMaui.VisualStudio.vsix
2025-12-19 05:13:16 -05:00

77 lines
1.7 KiB
C#

using Microsoft.Maui.Controls;
namespace $safeprojectname$;
/// <summary>
/// The main page of the application.
/// </summary>
public partial class MainPage : ContentPage
{
private int _count = 0;
public MainPage()
{
InitializeComponent();
}
private void InitializeComponent()
{
Title = "Home";
var layout = new VerticalStackLayout
{
Spacing = 25,
Padding = new Thickness(30, 0),
VerticalOptions = LayoutOptions.Center
};
var welcomeLabel = new Label
{
Text = "Hello, OpenMaui!",
FontSize = 32,
HorizontalOptions = LayoutOptions.Center
};
var instructionLabel = new Label
{
Text = "Welcome to .NET MAUI on Linux",
FontSize = 18,
HorizontalOptions = LayoutOptions.Center
};
var counterButton = new Button
{
Text = "Click me",
HorizontalOptions = LayoutOptions.Center
};
counterButton.Clicked += OnCounterClicked;
var image = new Image
{
Source = "dotnet_bot.png",
HeightRequest = 185,
HorizontalOptions = LayoutOptions.Center
};
layout.Children.Add(welcomeLabel);
layout.Children.Add(instructionLabel);
layout.Children.Add(counterButton);
layout.Children.Add(image);
Content = new ScrollView { Content = layout };
}
private void OnCounterClicked(object? sender, EventArgs e)
{
_count++;
if (sender is Button button)
{
button.Text = _count == 1
? $"Clicked {_count} time"
: $"Clicked {_count} times";
}
}
}