Created
July 7, 2025 08:03
-
-
Save luojunyuan/802fb002bccb7fd0c80cde8e153b3e06 to your computer and use it in GitHub Desktop.
blazonia app template
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public partial class App : BlazoniaApplication<MainWindow> | |
| { | |
| public override void Initialize() | |
| { | |
| AvaloniaXamlLoader.Load(this); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <Project Sdk="Microsoft.NET.Sdk.Razor"> | |
| <PropertyGroup> | |
| <OutputType>WinExe</OutputType> | |
| <TargetFramework>net9.0</TargetFramework> | |
| <Nullable>enable</Nullable> | |
| <ImplicitUsings>enable</ImplicitUsings> | |
| </PropertyGroup> | |
| <ItemGroup> | |
| <PackageReference Include="Avalonia.Desktop" Version="11.3.2" /> | |
| <PackageReference Include="Avalonia.Diagnostics" Version="11.3.2" > | |
| <IncludeAssets Condition="'$(Configuration)' != 'Debug'">None</IncludeAssets> | |
| <PrivateAssets Condition="'$(Configuration)' != 'Debug'">All</PrivateAssets> | |
| </PackageReference> | |
| <PackageReference Include="Avalonia.Fonts.Inter" Version="11.3.2" /> | |
| <PackageReference Include="Avalonia.Themes.Fluent" Version="11.3.2" /> | |
| <PackageReference Include="Blazonia" Version="0.0.0-alpha.0.888" /> | |
| </ItemGroup> | |
| <ItemGroup> | |
| <Compile Update="App.axaml.cs"> | |
| <DependentUpon>App.axaml</DependentUpon> | |
| <SubType>Code</SubType> | |
| </Compile> | |
| </ItemGroup> | |
| </Project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @using Blazonia.Components; | |
| @page "/" | |
| <Window Title="Counter" Width="600" Height="400"> | |
| <StackPanel> | |
| <Label FontSize="30">You pressed @_count times </Label> | |
| <CheckBox @bind-IsChecked="_showButton">Button visible</CheckBox> | |
| @if (_showButton! == true) | |
| { | |
| <Button OnClick="OnButtonClick">+1</Button> | |
| } | |
| </StackPanel> | |
| </Window> | |
| @code { | |
| int _count; | |
| bool? _showButton = true; | |
| void OnButtonClick() => _count++; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment