diff --git a/vsix/OpenMaui.VisualStudio/LICENSE.txt b/vsix/OpenMaui.VisualStudio/LICENSE.txt new file mode 100644 index 0000000..88d39b3 --- /dev/null +++ b/vsix/OpenMaui.VisualStudio/LICENSE.txt @@ -0,0 +1,23 @@ +MIT License + +Copyright (c) 2025 MarketAlly LLC + +Lead Architect: David H. Friedel Jr. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/vsix/OpenMaui.VisualStudio/OpenMaui.VisualStudio.csproj b/vsix/OpenMaui.VisualStudio/OpenMaui.VisualStudio.csproj new file mode 100644 index 0000000..a46d380 --- /dev/null +++ b/vsix/OpenMaui.VisualStudio/OpenMaui.VisualStudio.csproj @@ -0,0 +1,44 @@ + + + + net48 + latest + enable + + + true + true + false + false + true + false + true + + + Extensions + MarketAlly\OpenMaui + + + + + + + + + + Designer + + + + + + true + PreserveNewest + + + true + PreserveNewest + + + + diff --git a/vsix/OpenMaui.VisualStudio/ProjectTemplates/OpenMauiLinuxApp/App.cs b/vsix/OpenMaui.VisualStudio/ProjectTemplates/OpenMauiLinuxApp/App.cs new file mode 100644 index 0000000..30cb6d7 --- /dev/null +++ b/vsix/OpenMaui.VisualStudio/ProjectTemplates/OpenMauiLinuxApp/App.cs @@ -0,0 +1,17 @@ +namespace $safeprojectname$; + +/// +/// Application configuration and lifecycle management. +/// +public partial class App +{ + public App() + { + InitializeComponent(); + } + + private void InitializeComponent() + { + // Initialize application resources here + } +} diff --git a/vsix/OpenMaui.VisualStudio/ProjectTemplates/OpenMauiLinuxApp/MainPage.cs b/vsix/OpenMaui.VisualStudio/ProjectTemplates/OpenMauiLinuxApp/MainPage.cs new file mode 100644 index 0000000..bae0de6 --- /dev/null +++ b/vsix/OpenMaui.VisualStudio/ProjectTemplates/OpenMauiLinuxApp/MainPage.cs @@ -0,0 +1,76 @@ +using Microsoft.Maui.Controls; + +namespace $safeprojectname$; + +/// +/// The main page of the application. +/// +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"; + } + } +} diff --git a/vsix/OpenMaui.VisualStudio/ProjectTemplates/OpenMauiLinuxApp/MainPage.xaml b/vsix/OpenMaui.VisualStudio/ProjectTemplates/OpenMauiLinuxApp/MainPage.xaml new file mode 100644 index 0000000..82cdaa9 --- /dev/null +++ b/vsix/OpenMaui.VisualStudio/ProjectTemplates/OpenMauiLinuxApp/MainPage.xaml @@ -0,0 +1,41 @@ + + + + + + + +