jumpinjackie / avalonia-mdi-skeleton

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Avalonia MDI Skeleton

Actions Status

This repo provides a minimal and multi-platform MDI (Multi-Document Interface) skeleton desktop application built on-top of Avalonia

This skeleton app implements a hypothetical new user interface for the existing MapGuide Maestro application

Features

  • Uses Avalonia 11 and targets .net 8.0
  • Main UI layout in the style of applicationss like:
  • Supports Desktop and Browser WASM (Web Assembly) targets
    • Check out the WASM build of this application here
  • Strong usage of MVVM (via CommunityToolkit.Mvvm) and data-binding patterns
    • Usage of IMessenger and IRecipient<T> for inter-ViewModel communication
  • Dependency Injection via StrongInject (chosen for its source-generator and compile-time nature, which should make it more friendly for app trimming scenarios should we ever want to make a trimmed single-file published build)
  • Dynamically constructed and bound app menu (see MenuBuilder class) to facilitate potential future augementation of the final app menu via plugins.
  • Mimics the core functionalities of MapGuide Maestro
    • Presenting a login UI for connecting to a hypothetical MapGuide Server with mocked authentication
    • Once connected, provides a mocked and randomized tree view of a MapGuide Server's resources in a directory-like structure
      • Folder items can be opened to load a random mixture of child folders and resource items on demand.
      • Resource items can be double-clicked to open a (closeable) resource editor tab for that resource
      • Resource editor tabs embed the AvaloniaEdit editor component
    • This conceptual model should be easily translatable to other similar concepts, such as:
      • Connecting to a database, to explore schemas/tables/columns in a tree view
      • Opening a directory, to explore its files and subdirectories in a tree view
  • Demonstrates binding of polymorphic tab view models on the main TabControl via <UserControl.DataTemplates>. The main TabControl can show
    • Resource editor tabs
    • Welcome tab (shown on startup or Help - Show Welcome Screen)
    • Options tab (shown on Tools - Options)
  • Includes a GitHub Actions workflow that automatically:
    • Produces self-contained published builds for Windows/Linux/OSX/WASM. Artifacts uploaded and attached for each build.
    • Also produces an AppImage for Linux (thanks to PupNet Deploy)
    • Automatically pushes WASM builds to GitHub Pages gh-pages branch
    • Produces a release (with respective build artifacts) in draft/prerelease state on git tag.

TODO

  • Fix sidebar treeview not presenting scrollbars on overflow despite the designer suggesting (at design-time) that this should already be working
  • Basic persistent app options/settings system
    • Theme (light/dark)
    • Selected Language
  • i18n
  • Basic test suite
    • CI: Code coverage generation and reporting
  • CI: Changelog generation
  • CI: Release notes generation

Known Issues/Limitations

  • The resx-based i18n string bundles do not work on the WASM target. Regardless of whatever culture you assign on startup, the language will always be the default (English).
  • Node action buttons on the main tree view should only be displaying for the actively hovered node, but currently displays it for the hovered node and all of its parent folder nodes. I can't seem to nail down the correct selector (if this is even possible) to only cover action buttons for the actively hovered node.
  • The choice of packages used and patterns being employed are mostly constrained by our desire for a functional WASM target.
    • For example, I wanted to use this library for easy dialogs, but it didn't work in a WASM environment.
  • This author is not an expert on WPF or any other XAML-based frameworks and their best practices and so may be doing some things wrong
    • Feel free to correct me through pull requests 😉

About

License:MIT License


Languages

Language:C# 92.7%Language:CSS 3.6%Language:HTML 2.6%Language:JavaScript 1.1%