.NET 5.0 .NET Core 3.1
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Prism.DryIoc.Avalonia --version
NuGet\Install-Package Prism.DryIoc.Avalonia -Version
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Prism.DryIoc.Avalonia" Version="" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Prism.DryIoc.Avalonia --version
#r "nuget: Prism.DryIoc.Avalonia,"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Prism.DryIoc.Avalonia as a Cake Addin
#addin nuget:?package=Prism.DryIoc.Avalonia&version=

// Install Prism.DryIoc.Avalonia as a Cake Tool
#tool nuget:?package=Prism.DryIoc.Avalonia&version=


Prism.Avalonia provides your Avalonia apps with Prism framework support so you can navigate and perform dependency injection easier than before.

Package NuGet
Prism.Avalonia Prism.Avalonia NuGet Badge
Prism.DryIoc.Avalonia Prism.DryIoc.Avalonia NuGet Badge

Prism.Avalonia's logic and development approach is similar to that of Prism for WPF so you can get started right away with Prism for Avalonia!


Add the DryIoc package to your project:

Install-Package Prism.DryIoc.Avalonia -Version

How to use


public class App : PrismApplication
    public static bool IsSingleViewLifetime =>
            .Any(a => a == "--fbdev" || a == "--drm");

    public static AppBuilder BuildAvaloniaApp() =>

    public override void Initialize()
        base.Initialize();              // <-- Required

    protected override void RegisterTypes(IContainerRegistry containerRegistry)
        // Register Services
        containerRegistry.Register<IRestService, RestService>();

        // Views - Generic

        // Views - Region Navigation
        containerRegistry.RegisterForNavigation<DashboardView, DashboardViewModel>();
        containerRegistry.RegisterForNavigation<SettingsView, SettingsViewModel>();
        containerRegistry.RegisterForNavigation<SidebarView, SidebarViewModel>();

    protected override IAvaloniaObject CreateShell()
        if (IsSingleViewLifetime)
            return Container.Resolve<MainControl>(); // For Linux Framebuffer or DRM
            return Container.Resolve<MainWindow>();

    protected override void ConfigureModuleCatalog(IModuleCatalog moduleCatalog)
        // Register modules

    /// <summary>Called after <seealso cref="Initialize"/>.</summary>
    protected override void OnInitialized()
      // Register initial Views to Region.
      var regionManager = Container.Resolve<IRegionManager>();
      regionManager.RegisterViewWithRegion(RegionNames.ContentRegion, typeof(DashboardView));
      regionManager.RegisterViewWithRegion(RegionNames.SidebarRegion, typeof(SidebarView));


public static class Program
    public static AppBuilder BuildAvaloniaApp() =>
            .With(new X11PlatformOptions
                EnableMultiTouch = true,
                UseDBusMenu = true
            .With(new Win32PlatformOptions
                EnableMultitouch = true,
                AllowEglInitialization = true

    static int Main(string[] args)
        double GetScaling()
            var idx = Array.IndexOf(args, "--scaling");
            if (idx != 0 && args.Length > idx + 1 &&
                double.TryParse(args[idx + 1], NumberStyles.Any, CultureInfo.InvariantCulture, out var scaling))
                return scaling;
            return 1;

        var builder = BuildAvaloniaApp();
        if (args.Contains("--fbdev"))
            return builder.StartLinuxFbDev(args, scaling: GetScaling());
        else if (args.Contains("--drm"))
            return builder.StartLinuxDrm(args, scaling: GetScaling());
            return builder.StartWithClassicDesktopLifetime(args);

    static void SilenceConsole()
        new Thread(() =>
            Console.CursorVisible = false;
            while (true)
        { IsBackground = true }.Start();
Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.0-windows
.NET Core netcoreapp3.1
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated 107 2/8/2023 52 2/4/2023 454 12/9/2022 160 12/9/2022
8.1.97 836 7/18/2022 3,598 1/28/2021 454 9/26/2020 648 4/14/2020 445 2/11/2020 459 1/31/2020 403 1/30/2020 468 12/30/2019 466 12/18/2019 657 11/26/2019 863 9/3/2019 512 6/25/2019

* Fixed: Automatically performs `AutoWireViewModel`
   * No longer need to device `prism:ViewModelLocator.AutoWireViewModel="True"` in View
* Updated DryIoc to v4.8.0
* Updated to Avalonia v0.10.18