What is a module?
A module is a feature package that extends the Asv.Avalonia host with services, views, pages, dialogs, and registrations. The application chooses its modules during host configuration. A module does not require a separately downloaded plugin or a special entry-point interface.
The framework includes these optional packages:
Package | Purpose | Registration |
|---|---|---|
| Tile maps, geographic markers, coordinate dialogs, and map settings |
|
| Connections, device discovery, live packet inspection, and file inspection |
|
| NuGet plugin management and startup loading |
|
Add the relevant package reference to your application. In its existing host configuration callback, after the core framework and desktop shell registrations, register the modules you need:
This is a registration fragment, not a replacement for application startup. The complete desktop bootstrap is in Asv.Avalonia.Example.Desktop/Program.cs. Plugin loading also requires application-specific API and package-prefix configuration; see Plugins module.
Customize registration explicitly
Each module exposes a builder with RegisterDefault(), RegisterCore(), and RegisterShell(). The default registration combines the module's core and shell registrations.
A callback passed to RegisterModuleGeoMap, RegisterModuleIo, or RegisterModulePlugins replaces the default callback. It does not run after the defaults automatically. The same convention applies to nested registration methods that use a default callback.
For example, explicitly retain all GeoMap defaults when supplying a callback:
To deliberately select only part of a module, call the required registration methods instead. Check their dependencies before omitting shell or core components. Avoid registering the same defaults twice: collection registrations can accumulate multiple instances.
The ModuleGeoMap, ModuleIo, and ModulePlugins properties expose builders for extending an already configured module. Accessing a builder property does not register that module's defaults.
Module versus dynamic plugin
A module is linked into the application and configured by its host. A dynamic plugin is an installed package loaded by the Plugins module at startup. Its IPluginAppBuilder.Register(IHostApplicationBuilder) entry point can register pages, extensions, and services using the same builders as the application.
Use a module for functionality shipped with the application. Use dynamic plugins when an application intentionally supports installing separately packaged extensions with a shared API contract.
Continue with GeoMap, IO, or Plugins.
See the running application screenshots in Shell and navigation, GeoMap, IO, and Plugins.