Files
ClassicAssist.Avalonia/.qoder/repowiki/knowledge/en/ClassicAssist .NET Solution/ClassicAssist Launcher (WPF)/architecture_design.md
T
Beyhan Oğur d5f52cc3d3 first commit
2026-09-03 04:45:36 +03:00

1.8 KiB

  • Single WPF WinExe project (net48, UseWPF=true) whose entry point is App.xaml.cs; it bootstraps Exceptionless telemetry before showing the main window.
  • MVVM layout: BaseViewModel provides INotifyPropertyChanged plus two in-process ICommand implementations (RelayCommand, RelayAsyncCommand). Each screen has a XAML view + code-behind window paired with a ViewModel (MainViewModel, OptionsViewModel, ShardsViewModel).
  • MainViewModel owns the application lifecycle: reads/writes Launcher.json via Newtonsoft.Json, manages ClientPaths/DataPaths/Plugins collections, resolves shard hostnames through Utility.ResolveAddress, and finally Process.Starts ClassicUO.exe with -plugins, -ip, -port, -uopath, -encryption, -shard arguments. On exit it persists state back to JSON.
  • Shard configuration is split between built-in presets in the singleton ShardManager (double-checked-lock single instance) and user-defined entries persisted in Launcher.json; ShardsWindow / ShardsViewModel edit them.
  • ClassicUO launch flags are driven by reflection over ClassicOptions: each property is annotated with ClassicOptionAttribute (argument name, default value, conditional include rules), which both ReadClassicOptions (load from JSON) and BuildClassicOptions (emit CLI args) consume.
  • UI helpers live in Behaviours/ (WPF Interactivity behaviours), Controls/EditTextBlock (custom control), and ValueConverters/ (boolean/cell-width converters). Resources are localized via .resx files under Properties/.
  • Dependency direction: Views → ViewModels → ShardManager/Utility/ClassicOptions; no cross-viewmodel references except when one window passes its ViewModel into another (e.g. ShowOptionsWindow constructs OptionsViewModel with shared Plugins/ClassicOptions).