Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Esk.OddUI (Alpha version)

shot1

A cross-platform UI framework based on .NET 8. It combines WPF-inspired XAML-like markup, a DependencyProperty-based object model, SkiaSharp GPU rendering, and Silk.NET (GLFW) windowing, aiming to run on Windows/Linux/macOS.

Note: This project was designed and implemented through pair programming with AI (GitHub Copilot). Architectural direction and code review were human-led, while a significant portion of the boilerplate implementation and repetitive work was done together with AI.


Architecture

┌───────────────────────────────────────────────────────────────────┐
│                 Application Layer  (XAML/XML files)               │
├───────────────────────────────────────────────────────────────────┤
│  Esk.OddUI.Markup         ←──────→         Esk.OddUI.Core         │
│  (XML Parser,                             (VisualTree, Layout,    │
│   DataBinding,                             DependencyProperty,    │
│   MarkupExtensions)                        Events, Dispatcher)    │
│                                                    ↓              │
│              Esk.OddUI.Controls (Button, TextBlock, ...)          │
├───────────────────────────────────────────────────────────────────┤
│  Esk.OddUI.Rendering  (IRenderContext / draw command abstraction) │
│              ↓                                                    │
│  Esk.OddUI.Rendering.Skia  (SkiaSharp + GRContext)                │
│    → Windows: OpenGL  │  Linux: OpenGL (X11/Wayland)              │
│    → macOS:   OpenGL (Metal backend is a future task)             │
├───────────────────────────────────────────────────────────────────┤
│  Esk.OddUI.Platform  (IWindow / IInputProvider abstraction)       │
│  ┌──────────────┬──────────────┬───────────────────────┐          │
│  │ Platform.    │ Platform.    │ Platform.macOS        │          │
│  │ Windows      │ Linux        │ (Silk.NET GLFW)       │          │
│  │ (Silk.NET)   │ (Silk.NET)   │                       │          │
│  └──────────────┴──────────────┴───────────────────────┘          │
└───────────────────────────────────────────────────────────────────┘

Project Structure

Esk.OddUI.slnx
├── src/
│   ├── Esk.OddUI.Core/              # DependencyObject/Property, VisualTree, Dispatcher, RoutedEvent
│   ├── Esk.OddUI.Markup/            # XML parser, markup extensions such as {Binding}/{StaticResource}
│   ├── Esk.OddUI.Controls/          # Border, TextBlock, Button, Panel, ToggleButton, UserControl, etc.
│   ├── Esk.OddUI.Rendering/         # Rendering abstraction (ICanvas, IRenderContext)
│   ├── Esk.OddUI.Rendering.Skia/    # SkiaSharp implementation
│   ├── Esk.OddUI.Platform/          # Platform abstraction (IWindow, IInputProvider)
│   ├── Esk.OddUI.Platform.Windows/
│   ├── Esk.OddUI.Platform.Linux/
│   ├── Esk.OddUI.Platform.macOS/
│   └── Esk.OddUI.App/               # Application entry point · lifecycle
├── samples/
│   └── Esk.OddUI.Sample/            # Demo app for all controls
└── tests/
    └── Esk.OddUI.Tests/

Key Features

  • DependencyProperty systemDependencyObject/DependencyProperty supporting value inheritance, coercion, and change callbacks
  • Layout engine — WPF-style Measure → Arrange two-pass layout with dirty-propagation-based recalculation
  • XML markup parser{Binding}, {StaticResource}, x:Name, DataContext propagation, INotifyPropertyChanged binding
  • Control libraryBorder, TextBlock, Button, TextBox, StackPanel, Grid, Canvas, WrapPanel, ToggleButton, CheckBox, RadioButton, ProgressBar, Slider, Image, UserControl, and more
  • GPU rendering — SkiaSharp-based ICanvas abstraction with rectangle/text/image drawing
  • Cross-platform windowing — Silk.NET (GLFW) based window creation and input handling for Windows/Linux/macOS (automatically selected via runtime OS detection)

Getting Started

Requirements

  • .NET 8 SDK

Build

dotnet build -c Debug

Run the sample app

dotnet run --project samples\Esk.OddUI.Sample\Esk.OddUI.Sample.csproj

The sample app demonstrates usage examples of all implemented controls (Button, CheckBox, RadioButton, Slider, ProgressBar, Image, Canvas, WrapPanel, UserControl-based CounterControl, etc.).

Known Limitations

  • macOS currently creates windows via the OpenGL path first. The SkiaSharp Metal backend requires additional CAMetalLayer/MTLDevice native interop, which has been left as a future task.
  • The Linux/macOS platform projects have only been verified to compile successfully in a Windows development environment; actual runtime verification on real hardware has not yet been performed.
  • The Style/ControlTemplate system, ScrollViewer, ListBox/ItemsControl, and ComboBox are out of MVP scope and are planned to be addressed in a separate future phase.

Tech Stack

Role Library
Cross-platform windowing Silk.NET.Windowing (GLFW)
GPU 2D rendering SkiaSharp
GPU Surface Silk.NET.OpenGL
Testing xUnit

About

C#,GUI

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages