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:
71
templates/openmaui-linux-app/.template.config/template.json
Normal file
71
templates/openmaui-linux-app/.template.config/template.json
Normal file
@@ -0,0 +1,71 @@
|
||||
{
|
||||
"$schema": "http://json.schemastore.org/template",
|
||||
"author": "MarketAlly LLC",
|
||||
"classifications": ["MAUI", "Linux", "Desktop", "App", "OpenMaui"],
|
||||
"identity": "OpenMaui.Linux.App",
|
||||
"name": "OpenMaui Linux Application",
|
||||
"shortName": "openmaui-linux",
|
||||
"tags": {
|
||||
"language": "C#",
|
||||
"type": "project"
|
||||
},
|
||||
"sourceName": "OpenMauiLinuxApp",
|
||||
"preferNameDirectory": true,
|
||||
"symbols": {
|
||||
"Framework": {
|
||||
"type": "parameter",
|
||||
"description": "The target framework for the project.",
|
||||
"datatype": "choice",
|
||||
"choices": [
|
||||
{
|
||||
"choice": "net9.0",
|
||||
"description": "Target .NET 9.0"
|
||||
},
|
||||
{
|
||||
"choice": "net8.0",
|
||||
"description": "Target .NET 8.0"
|
||||
}
|
||||
],
|
||||
"defaultValue": "net9.0",
|
||||
"replaces": "net9.0"
|
||||
},
|
||||
"DisplayServer": {
|
||||
"type": "parameter",
|
||||
"description": "The display server to use.",
|
||||
"datatype": "choice",
|
||||
"choices": [
|
||||
{
|
||||
"choice": "auto",
|
||||
"description": "Auto-detect display server"
|
||||
},
|
||||
{
|
||||
"choice": "x11",
|
||||
"description": "Force X11"
|
||||
},
|
||||
{
|
||||
"choice": "wayland",
|
||||
"description": "Force Wayland"
|
||||
}
|
||||
],
|
||||
"defaultValue": "auto"
|
||||
},
|
||||
"skipRestore": {
|
||||
"type": "parameter",
|
||||
"datatype": "bool",
|
||||
"description": "Skip automatic restore after project creation.",
|
||||
"defaultValue": "false"
|
||||
}
|
||||
},
|
||||
"primaryOutputs": [
|
||||
{ "path": "OpenMauiLinuxApp.csproj" }
|
||||
],
|
||||
"postActions": [
|
||||
{
|
||||
"condition": "(!skipRestore)",
|
||||
"description": "Restore NuGet packages required by this project.",
|
||||
"manualInstructions": [{ "text": "Run 'dotnet restore'" }],
|
||||
"actionId": "210D431B-A78B-4D2F-B762-4ED3E3EA9025",
|
||||
"continueOnError": true
|
||||
}
|
||||
]
|
||||
}
|
||||
14
templates/openmaui-linux-app/App.cs
Normal file
14
templates/openmaui-linux-app/App.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
// 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;
|
||||
|
||||
namespace OpenMauiLinuxApp;
|
||||
|
||||
public class App : Application
|
||||
{
|
||||
public App()
|
||||
{
|
||||
MainPage = new MainPage();
|
||||
}
|
||||
}
|
||||
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";
|
||||
}
|
||||
}
|
||||
27
templates/openmaui-linux-app/OpenMauiLinuxApp.csproj
Normal file
27
templates/openmaui-linux-app/OpenMauiLinuxApp.csproj
Normal file
@@ -0,0 +1,27 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<RootNamespace>OpenMauiLinuxApp</RootNamespace>
|
||||
<AssemblyName>OpenMauiLinuxApp</AssemblyName>
|
||||
<ApplicationTitle>OpenMauiLinuxApp</ApplicationTitle>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<!-- OpenMaui Linux Platform -->
|
||||
<PackageReference Include="OpenMaui.Controls.Linux" Version="1.0.0-preview.1" />
|
||||
|
||||
<!-- Core MAUI packages -->
|
||||
<PackageReference Include="Microsoft.Maui.Controls" Version="9.0.40" />
|
||||
<PackageReference Include="Microsoft.Maui.Graphics" Version="9.0.40" />
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Embed Resources -->
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Resources\**\*" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
18
templates/openmaui-linux-app/Program.cs
Normal file
18
templates/openmaui-linux-app/Program.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
|
||||
using OpenMaui.Platform.Linux.Linux;
|
||||
|
||||
namespace OpenMauiLinuxApp;
|
||||
|
||||
public class Program
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
var app = LinuxApplication.CreateBuilder()
|
||||
.UseApp<App>()
|
||||
.Build();
|
||||
|
||||
app.Run();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user