Upgrade Guide
Current release: Crystal.Avalonia 2.0.1
| From | Guide |
|---|---|
| 2.0.0 | Upgrade from 2.0.0 — CreateShellFromDi removed, shell no longer in DI |
| 1.2.x | Upgrade from v1.2 — ViewModel-only DI, no AddMvvmHybrid |
Quick Reference (2.0.1)
public override void RegisterServices(IServiceCollection services)
{
services.AddMvvmTransient<MainView, MainViewModel>();
}
public override void CreateShell(IServiceProvider sp)
{
CreateShell<MainWindow, MainView>();
}
- ViewModel → DI (
AddMvvm*) - View → mapping only; created by XAML or
ViewLocator - Shell (
MainWindow/MainView) →CreateShell<...>()withnew, not DI