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 6, 7 & 8
https://github.com/wieslawsoltes/nxui
avalonia avaloniaui csharp dotnet minimal xaml
Last synced: about 1 month ago
JSON representation
NXUI (nex-ui), next-gen UI - Create minimal Avalonia applications using C# 10 and .NET 6, 7 & 8
- Host: GitHub
- URL: https://github.com/wieslawsoltes/nxui
- Owner: wieslawsoltes
- License: mit
- Created: 2021-09-01T20:57:37.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-07-22T21:01:19.000Z (4 months ago)
- Last Synced: 2024-09-30T11:02:02.626Z (about 1 month ago)
- Topics: avalonia, avaloniaui, csharp, dotnet, minimal, xaml
- Language: C#
- Homepage: http://www.nxui.net
- Size: 2.98 MB
- Stars: 136
- Watchers: 8
- Forks: 4
- Open Issues: 2
-
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 6, 7 or 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
```