NXUI (nex-ui), next-gen UI - Create minimal Avalonia applications using C# 10 and .NET 6 and 7
Перейти к файлу
Wiesław Šoltés 6acf06ff31 Update Templates.Extensions.cs 2022-10-11 13:25:23 +02:00
.github Create FUNDING.yml 2022-05-13 09:53:33 +02:00
samples Update MinimalAvalonia.IntegrationTest.csproj 2022-08-20 00:54:12 +02:00
src Update Templates.Extensions.cs 2022-10-11 13:25:23 +02:00
.editorconfig Create .editorconfig 2021-09-01 23:06:26 +02:00
.gitattributes Initial commit 2021-09-01 22:57:32 +02:00
.gitignore Create .gitignore 2021-09-01 23:06:30 +02:00
Directory.Build.props Update to 11.0.0-preview2 2022-10-11 06:41:14 +00:00
MinimalAvalonia.sln Format samples 2022-08-04 13:43:27 +02:00
NuGet.Config Create NuGet.Config 2022-05-11 07:20:27 +02:00
README.md Update README.md 2022-08-26 09:33:13 +02:00
global.json Update global.json 2022-05-11 21:47:04 +02:00

README.md

MinimalAvalonia

NuGet NuGet

Creating minimal Avalonia application using C# 10 and .NET 6

https://user-images.githubusercontent.com/2297442/132313187-32f18c4b-e894-46db-9a9d-9de02f30835e.mp4

Usage

<PackageReference Include="MinimalAvalonia" Version="11.0.0-preview1" />
Window Build() => Window().Content(Label().Content("Minimal Avalonia"));

AppBuilder.Configure<Application>()
  .UsePlatformDetect()
  .UseFluentTheme()
  .StartWithClassicDesktopLifetime(Build, args);
var count = 0;

Window Build()
  => Window(out var window)
    .Title("MinimalAvalonia").Width(400).Height(300)
    .Content(
      StackPanel()
        .Children(
          Button(out var button)
            .Content("Welcome to Avalonia, please click me!"),
          TextBox(out var tb1)
            .Text("Minimal Avalonia"),
          TextBox()
            .Text(window.BindTitle()),
          Label()
            .Content(button.ObserveOnClick().Select(_ => ++count).Select(x => $"You clicked {x} times."))))
    .Title(tb1.ObserveText().Select(x => x?.ToUpper()));

AppBuilder.Configure<Application>()
  .UsePlatformDetect()
  .UseFluentTheme()
  .WithApplicationName("MinimalAvalonia")
  .StartWithClassicDesktopLifetime(Build, args);

Generate

cd src/Generator
dotnet run -- ../MinimalAvalonia/Generated