Rename package to OpenMaui.Controls.Linux
- Changed package ID from Microsoft.Maui.Controls.Linux to OpenMaui.Controls.Linux - Updated all project files, namespaces, and documentation - Renamed template from maui-linux to openmaui-linux - Updated NuGet badges and install commands - Maintained MarketAlly LLC as owner/author Package: OpenMaui.Controls.Linux Template: OpenMaui.Linux.Templates Install: dotnet add package OpenMaui.Controls.Linux --prerelease
This commit is contained in:
64
templates/openmaui-linux-app/MainPage.cs
Normal file
64
templates/openmaui-linux-app/MainPage.cs
Normal file
@@ -0,0 +1,64 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
|
||||
using Microsoft.Maui.Controls;
|
||||
using Microsoft.Maui.Graphics;
|
||||
|
||||
namespace OpenMauiLinuxApp;
|
||||
|
||||
public class MainPage : ContentPage
|
||||
{
|
||||
private int _count = 0;
|
||||
private readonly Label _counterLabel;
|
||||
|
||||
public MainPage()
|
||||
{
|
||||
Title = "OpenMauiLinuxApp";
|
||||
|
||||
_counterLabel = new Label
|
||||
{
|
||||
Text = "Click the button",
|
||||
HorizontalOptions = LayoutOptions.Center,
|
||||
FontSize = 18
|
||||
};
|
||||
|
||||
var button = new Button
|
||||
{
|
||||
Text = "Click me",
|
||||
HorizontalOptions = LayoutOptions.Center
|
||||
};
|
||||
button.Clicked += OnCounterClicked;
|
||||
|
||||
var image = new Image
|
||||
{
|
||||
Source = "dotnet_bot.png",
|
||||
HeightRequest = 200,
|
||||
HorizontalOptions = LayoutOptions.Center
|
||||
};
|
||||
|
||||
Content = new VerticalStackLayout
|
||||
{
|
||||
Spacing = 25,
|
||||
Padding = new Thickness(30, 0),
|
||||
VerticalOptions = LayoutOptions.Center,
|
||||
Children =
|
||||
{
|
||||
new Label
|
||||
{
|
||||
Text = "Hello, .NET MAUI on Linux!",
|
||||
FontSize = 32,
|
||||
HorizontalOptions = LayoutOptions.Center
|
||||
},
|
||||
image,
|
||||
_counterLabel,
|
||||
button
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private void OnCounterClicked(object? sender, EventArgs e)
|
||||
{
|
||||
_count++;
|
||||
_counterLabel.Text = _count == 1 ? "Clicked 1 time" : $"Clicked {_count} times";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user