Alcove.Wpf 0.0.2-alpha

This is a prerelease version of Alcove.Wpf.
dotnet add package Alcove.Wpf --version 0.0.2-alpha
                    
NuGet\Install-Package Alcove.Wpf -Version 0.0.2-alpha
                    
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="Alcove.Wpf" Version="0.0.2-alpha" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Alcove.Wpf" Version="0.0.2-alpha" />
                    
Directory.Packages.props
<PackageReference Include="Alcove.Wpf" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Alcove.Wpf --version 0.0.2-alpha
                    
#r "nuget: Alcove.Wpf, 0.0.2-alpha"
                    
#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.
#:package Alcove.Wpf@0.0.2-alpha
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Alcove.Wpf&version=0.0.2-alpha&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Alcove.Wpf&version=0.0.2-alpha&prerelease
                    
Install as a Cake Tool

Alcove.Wpf

WPF add-on for Alcove: plugins with XAML inside cells (AssemblyLoadContexts). WPF finds assemblies by simple name among everything loaded in the process, and its own fallback loads go to the default context, never to a cell. This package makes plugins' XAML work there.

Host

using Alcove;
using Alcove.Wpf;
using Alcove.Wpf.Threading;   // OnDispatcher

var options = new PluginHostOptions { Root = root, PluginPackageType = "MyAppPlugin", HostOwnedPackages = { "MyApp.Sdk" } };
options.UseWpf(Application.Current, wpf =>
{
    wpf.ForwardDefaultContextLoads = true;   // opt-in, process-wide while the host lives (see below)
    wpf.MapViewModelsToViews = true;         // opt-in: FooViewModel -> FooView DataTemplates
});
await using var host = PluginHost.Create(options);
var catalog = host.Catalog.OnDispatcher(Application.Current.Dispatcher);   // callbacks on the UI thread
catalog.Observe<IToolWindow>(e => windows.Add(e.GetInstance()));
await host.LoadAsync();

UseWpf works with Alcove.DependencyInjection and Alcove.Autofac in either order: the core already creates every extension inside its cell's contextual reflection scope, whichever activator is set.

Set this switch in the host's project file (a message is logged when it's missing):

<ItemGroup>
  <RuntimeHostConfigurationOption Include="Switch.System.Windows.Baml2006.AppendLocalAssemblyVersionForSourceUri" Value="true" />
</ItemGroup>
Setting Default What it does
PreloadWpfAssemblies on Loads each cell's WPF-relevant private assemblies when the cell is created (or grows by a hot install), so a control library used only from XAML is found.
MergePluginResources on Merges each plugin assembly's [assembly: PluginResources("...")] dictionaries, or Themes/Plugin.xaml, into the app's resources (below the app's own) before the plugin registers; removed when the host is disposed.
ForwardDefaultContextLoads off Registers an AssemblyLoadContext.Default.Resolving handler for the host's lifetime: a failed default-context load goes to the single cell owning a private copy of that name (version ignored). Covers rolled-forward XAML libraries and external theme assemblies. Several cells with different copies: not resolved, logged. This is process-wide behaviour, the one opt-in exception to "no global state" (ADR 0012).
MapViewModelsToViews off Adds implicit DataTemplates for FooViewModel → FooView (same namespace, or ViewModels → Views).
Resources app resources Where plugins' dictionaries are merged.

Merging and removing run on the dispatcher's thread: inline when the host loads there, otherwise with a blocking Dispatcher.Invoke. Don't block the UI thread synchronously on LoadAsync/InstallAsync/DisposeAsync; await them.

DispatcherExtensionCatalog runs Observe and ExtensionsAdded callbacks at once when they're raised on the UI thread, and queues them with BeginInvoke otherwise (the loading thread never waits for the UI thread).

App SDK and plugins

SharedResourceKey<T>, PluginPackUri and [assembly: PluginResources(...)] are in Alcove.Wpf.Resources, ViewTemplates in Alcove.Wpf.Views, and DispatcherExtensionCatalog in Alcove.Wpf.Threading.

  • Shared resource keys as constants in the app's contracts package or app SDK (host-owned): public static readonly SharedResourceKey<Brush> Accent = new("MyApp.Accent");, used as {DynamicResource {x:Static sdk:AppKeys.Accent}}, or from code with TryFindResource(key, out var brush).
  • PluginPackUri.Create(assembly, "Themes/Colors.xaml") gives /Name;v1.2.3.4;component/Themes/Colors.xaml (plus the public key token when strong-named): always versioned, so it can't reach another cell's copy of the assembly.
  • Plugins referencing Alcove.Wpf with Alcove.Sdk treat it as host-owned automatically (buildTransitive).
Product Compatible and additional computed target framework versions.
.NET net10.0-windows7.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
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
0.0.2-alpha 66 10/23/2026
0.0.1-alpha 84 10/20/2026