Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wieslawsoltes/nxui
NXUI (nex-ui), next-gen UI - Create minimal Avalonia applications using C# 10 and .NET 8
https://github.com/wieslawsoltes/nxui
avalonia avaloniaui csharp dotnet minimal xaml
Last synced: 1 day ago
JSON representation
NXUI (nex-ui), next-gen UI - Create minimal Avalonia applications using C# 10 and .NET 8
- Host: GitHub
- URL: https://github.com/wieslawsoltes/nxui
- Owner: wieslawsoltes
- License: mit
- Created: 2021-09-01T20:57:37.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-10-31T10:53:03.000Z (about 2 months ago)
- Last Synced: 2024-12-21T19:05:52.322Z (1 day ago)
- Topics: avalonia, avaloniaui, csharp, dotnet, minimal, xaml
- Language: C#
- Homepage:
- Size: 3.13 MB
- Stars: 151
- Watchers: 8
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
Awesome Lists containing this project
README
# NXUI (next-gen UI)
[![NuGet](https://img.shields.io/nuget/v/NXUI.svg)](https://www.nuget.org/packages/NXUI)
[![NuGet](https://img.shields.io/nuget/dt/NXUI.svg)](https://www.nuget.org/packages/NXUI)Creating minimal [Avalonia](https://avaloniaui.net/) next generation (NXUI, next-gen UI) application using C# 10 and .NET 8
https://user-images.githubusercontent.com/2297442/132313187-32f18c4b-e894-46db-9a9d-9de02f30835e.mp4
# Requisites
### NXUI
```xml
```
or for F# support:
```xml
```
Additionally, depending on the application type:
### Desktop
For Desktop extensions:
```xml```
or using plain Avalonia:
```xml```
### Browser
```xml
```
```
dotnet workload install wasm-tools
```# Usage
```csharp
Window Build() => Window().Content(Label().Content("NXUI"));AppBuilder.Configure()
.UsePlatformDetect()
.UseFluentTheme()
.StartWithClassicDesktopLifetime(Build, args);
``````csharp
var count = 0;Window Build()
=> Window(out var window)
.Title("NXUI").Width(400).Height(300)
.Content(
StackPanel()
.Children(
Button(out var button)
.Content("Welcome to Avalonia, please click me!"),
TextBox(out var tb1)
.Text("NXUI"),
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()
.UsePlatformDetect()
.UseFluentTheme()
.WithApplicationName("NXUI")
.StartWithClassicDesktopLifetime(Build, args);
```Minimalistic Desktop app:
```csharp
Run(
() => Window().Content(Label().Content("NXUI")),
"NXUI",
args,
ThemeVariant.Dark);
```# Generate
C#
```bash
cd src/Generator
dotnet run -- ../NXUI/Generated
```F#
```bash
cd src/Generator
dotnet run -- ../NXUI.FSharp/Generated -fsharp
```