diff --git a/Misc./avalonia_hw/App.axaml b/Misc./avalonia_hw/App.axaml new file mode 100644 index 0000000..07a3712 --- /dev/null +++ b/Misc./avalonia_hw/App.axaml @@ -0,0 +1,10 @@ +<Application xmlns="https://github.com/avaloniaui" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + x:Class="test.App" + RequestedThemeVariant="Default"> + <!-- "Default" ThemeVariant follows system theme variant. "Dark" or "Light" are other available options. --> + + <Application.Styles> + <FluentTheme /> + </Application.Styles> +</Application> \ No newline at end of file diff --git a/Misc./avalonia_hw/App.axaml.cs b/Misc./avalonia_hw/App.axaml.cs new file mode 100644 index 0000000..76189ce --- /dev/null +++ b/Misc./avalonia_hw/App.axaml.cs @@ -0,0 +1,23 @@ +using Avalonia; +using Avalonia.Controls.ApplicationLifetimes; +using Avalonia.Markup.Xaml; + +namespace test; + +public partial class App : Application +{ + public override void Initialize() + { + AvaloniaXamlLoader.Load(this); + } + + public override void OnFrameworkInitializationCompleted() + { + if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) + { + desktop.MainWindow = new MainWindow(); + } + + base.OnFrameworkInitializationCompleted(); + } +} \ No newline at end of file diff --git a/Misc./avalonia_hw/MainWindow.axaml b/Misc./avalonia_hw/MainWindow.axaml new file mode 100644 index 0000000..076d66f --- /dev/null +++ b/Misc./avalonia_hw/MainWindow.axaml @@ -0,0 +1,9 @@ +<Window xmlns="https://github.com/avaloniaui" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" + x:Class="test.MainWindow" + Title="test"> + Welcome to Avalonia! +</Window> diff --git a/Misc./avalonia_hw/MainWindow.axaml.cs b/Misc./avalonia_hw/MainWindow.axaml.cs new file mode 100644 index 0000000..2cf0533 --- /dev/null +++ b/Misc./avalonia_hw/MainWindow.axaml.cs @@ -0,0 +1,11 @@ +using Avalonia.Controls; + +namespace test; + +public partial class MainWindow : Window +{ + public MainWindow() + { + InitializeComponent(); + } +} \ No newline at end of file diff --git a/Misc./avalonia_hw/Program.cs b/Misc./avalonia_hw/Program.cs new file mode 100644 index 0000000..f7413c4 --- /dev/null +++ b/Misc./avalonia_hw/Program.cs @@ -0,0 +1,21 @@ +using Avalonia; +using System; + +namespace test; + +class Program +{ + // Initialization code. Don't use any Avalonia, third-party APIs or any + // SynchronizationContext-reliant code before AppMain is called: things aren't initialized + // yet and stuff might break. + [STAThread] + public static void Main(string[] args) => BuildAvaloniaApp() + .StartWithClassicDesktopLifetime(args); + + // Avalonia configuration, don't remove; also used by visual designer. + public static AppBuilder BuildAvaloniaApp() + => AppBuilder.Configure<App>() + .UsePlatformDetect() + .WithInterFont() + .LogToTrace(); +} diff --git a/Misc./avalonia_hw/app.manifest b/Misc./avalonia_hw/app.manifest new file mode 100644 index 0000000..5b73987 --- /dev/null +++ b/Misc./avalonia_hw/app.manifest @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1"> + <!-- This manifest is used on Windows only. + Don't remove it as it might cause problems with window transparency and embedded controls. + For more details visit https://learn.microsoft.com/en-us/windows/win32/sbscs/application-manifests --> + <assemblyIdentity version="1.0.0.0" name="test.Desktop"/> + + <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"> + <application> + <!-- A list of the Windows versions that this application has been tested on + and is designed to work with. Uncomment the appropriate elements + and Windows will automatically select the most compatible environment. --> + + <!-- Windows 10 --> + <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" /> + </application> + </compatibility> +</assembly> diff --git a/Misc./avalonia_hw/test.csproj b/Misc./avalonia_hw/test.csproj new file mode 100644 index 0000000..336c0d0 --- /dev/null +++ b/Misc./avalonia_hw/test.csproj @@ -0,0 +1,19 @@ +<Project Sdk="Microsoft.NET.Sdk"> + <PropertyGroup> + <OutputType>WinExe</OutputType> + <TargetFramework>net8.0</TargetFramework> + <Nullable>enable</Nullable> + <BuiltInComInteropSupport>true</BuiltInComInteropSupport> + <ApplicationManifest>app.manifest</ApplicationManifest> + <AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault> + </PropertyGroup> + + <ItemGroup> + <PackageReference Include="Avalonia" Version="11.0.10" /> + <PackageReference Include="Avalonia.Desktop" Version="11.0.10" /> + <PackageReference Include="Avalonia.Themes.Fluent" Version="11.0.10" /> + <PackageReference Include="Avalonia.Fonts.Inter" Version="11.0.10" /> + <!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.--> + <PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.10" /> + </ItemGroup> +</Project>