first commit
This commit is contained in:
+8
@@ -0,0 +1,8 @@
|
||||
schema_version: 1
|
||||
module_path: classic_assist_avalonia
|
||||
title: ClassicAssist Avalonia Desktop UI
|
||||
scope:
|
||||
- ClassicAssist.Avalonia/
|
||||
source_files: []
|
||||
depends_on: []
|
||||
related_to: []
|
||||
+1
@@ -0,0 +1 @@
|
||||
Entry point `Program.Main` builds an `AppBuilder` configured with `UsePlatformDetect`, `LogToTrace`, and `UseReactiveUI`; `App.OnFrameworkInitializationCompleted` creates the root `MainWindow` with a `MainWindowViewModel` and wires it into `Assistant.Engine.MainWindow`. The module is loaded as a plugin by the core engine: `Engine.Install` (in the `Assistant` namespace) loads `ClassicAssist.Shared.dll` via `Assembly.LoadFile`, subscribes to `Options.SaveEvent`/`LoadEvent` to serialize/deserialize every `BaseViewModel` implementing `ISettingProvider`, then calls `LoadUI`. `LoadUI` branches on `SEngine.GetPlatformType()`: on Unix it starts the Avalonia app on a background thread; otherwise it calls `SetupWithoutStarting()` so the core can set `SEngine.Dispatcher = new AvaloniaDispatcher(Dispatcher.UIThread)` and `SEngine.UIInvoker = new AvaloniaUIInvoker(...)` before showing windows. `AvaloniaUIInvoker` implements `IUIInvoker` using reflection to construct `Window` subclasses by name, exposing `Invoke`, `InvokeDialog<T>`, `GetHueAsync`, and clipboard access through `IClipboard`. Views live under `Views/` (root windows plus `Agents/` tabbed sub-views), each paired with a `.axaml.cs` code-behind; reusable widgets are in `Controls/` (e.g. `GroupBox` extending `HeaderedContentControl` with a XAML theme); shared helpers (`Misc/`) provide behaviors, value converters, and the `AvaloniaMessageBoxProvider`. Dependencies flow one-way: this module depends on `ClassicAssist.Shared`, `ClassicAssist.Data`, `ClassicAssist.Misc`, and `ClassicAssist.UI.ViewModels`; the core never references Avalonia types directly — it only sees the `IDispatcher`/`IUIInvoker`/`IMessageBoxProvider` abstractions.
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
- Each view/window follows the `.axaml` + `.axaml.cs` split where the code-behind constructor simply calls `InitializeComponent()` and leaves logic to the ViewModel.
|
||||
- Cross-thread UI marshalling goes exclusively through `SEngine.Dispatcher.Invoke` / `InvokeAsync` rather than direct `Dispatcher` usage in business code.
|
||||
- User-facing dialogs are surfaced to the core via `IUIInvoker.Invoke`/`InvokeDialog<T>` by type-name reflection instead of direct window construction from non-UI assemblies.
|
||||
- Persistent settings are implemented by having ViewModels implement `ISettingProvider` and registering handlers on `Options.SaveEvent`/`LoadEvent` to iterate `BaseViewModel.Instances`.
|
||||
+1
@@ -0,0 +1 @@
|
||||
Avalonia-based desktop shell that hosts ClassicAssist's ReactiveUI MVVM views, custom controls, and cross-platform windowing/clipboard integration.
|
||||
+1
@@ -0,0 +1 @@
|
||||
Avalonia UI with ReactiveUI for MVVM binding; embedded AvaloniaEdit binaries (`AvaloniaEdit.dll/.pdb`) ship with the package; Linux uses a dedicated background thread for the Avalonia loop while Windows initializes inline via `SetupWithoutStarting()`.
|
||||
Reference in New Issue
Block a user