configuring-avalonia-dependency-injection — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited configuring-avalonia-dependency-injection (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Apply the same GenericHost pattern in AvaloniaUI as in WPF
The templates folder contains a .NET 9 AvaloniaUI project example.
templates/
├── AvaloniaDISample.App/ ← Avalonia Application Project
│ ├── Views/
│ │ ├── MainWindow.axaml
│ │ └── MainWindow.axaml.cs
│ ├── App.axaml
│ ├── App.axaml.cs
│ ├── Program.cs
│ ├── GlobalUsings.cs
│ └── AvaloniaDISample.App.csproj
└── AvaloniaDISample.ViewModels/ ← ViewModel Class Library (UI framework independent)
├── MainViewModel.cs
├── GlobalUsings.cs
└── AvaloniaDISample.ViewModels.csproj// App.axaml.cs
namespace MyApp;
using Avalonia;
using Avalonia.Controls.ApplicationLifetimes;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
public partial class App : Application
{
private IHost? _host;
public override void Initialize()
{
AvaloniaXamlLoader.Load(this);
}
public override void OnFrameworkInitializationCompleted()
{
// Create GenericHost and register services
_host = Host.CreateDefaultBuilder()
.ConfigureServices((context, services) =>
{
// Register services
services.AddSingleton<IUserRepository, UserRepository>();
services.AddSingleton<IUserService, UserService>();
services.AddTransient<IDialogService, DialogService>();
// Register ViewModels
services.AddTransient<MainViewModel>();
// Register Views
services.AddSingleton<MainWindow>();
})
.Build();
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
{
desktop.MainWindow = _host.Services.GetRequiredService<MainWindow>();
}
base.OnFrameworkInitializationCompleted();
}
}~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.