CW.RevitAppFramework.2019
26.6.1
See the version list below for details.
dotnet add package CW.RevitAppFramework.2019 --version 26.6.1
NuGet\Install-Package CW.RevitAppFramework.2019 -Version 26.6.1
<PackageReference Include="CW.RevitAppFramework.2019" Version="26.6.1"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
<PackageVersion Include="CW.RevitAppFramework.2019" Version="26.6.1" />
<PackageReference Include="CW.RevitAppFramework.2019"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add CW.RevitAppFramework.2019 --version 26.6.1
#r "nuget: CW.RevitAppFramework.2019, 26.6.1"
#:package CW.RevitAppFramework.2019@26.6.1
#addin nuget:?package=CW.RevitAppFramework.2019&version=26.6.1
#tool nuget:?package=CW.RevitAppFramework.2019&version=26.6.1
CW.RevitAppFramework
Overview
CW.RevitAppFramework is a framework for building WPF-based extensions for Autodesk Revit. It provides a structured MVVM architecture with built-in support for executing commands in Revit context, managing UI resources, and handling dependencies across Revit versions.
Features
- Multi-version support: compatible with Revit 2019 through 2026
- MVVM pattern implementation: built on MVVMFluent.WPF
- CQRS pattern: command and query segregation for clear operations
- External event handler: safe execution of Revit operations from UI threads
- Resource management: shared theme and resource handling
- Dependency injection: service registration and resolution
- WPF UI integration: modern UI components via WPF-UI
Architecture
Core Components
RevitContext: wraps Revit'sUIApplicationfor document/model accessExternalEventExecutor: executes commands and queries in Revit API contextAppExternalEventHandler: manages queued operations executed in RevitServiceFactory: creates and configures dependency injection services
MVVM Components
RevitViewModelBase: base class for view models with Revit command executionRevitCommandFluent: fluent API for defining and executing Revit operationsResourceInjectionBehavior: XAML behavior for applying global styles
Installation
Add the package that matches your Revit version:
<PackageReference Include="CW.RevitAppFramework.<RevitVersion>" Version="26.*">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Example:
<PackageReference Include="CW.RevitAppFramework.2026" Version="1.*" />
Usage
1. Initialize Services
Set up your service container and initialize framework services:
var provider = ServiceFactory.Create(context.UIApplication, services =>
{
services
.RegisterAppServices()
.AddSingleton(args);
});
2. Create View Models
Derive view models from RevitViewModelBase to access Revit command execution:
public class HomeViewModel(IExternalEventExecutor externalEventExecutor)
: RevitViewModelBase(externalEventExecutor)
{
public string? DocumentTitle
{
get => Get<string?>();
set => Set(value);
}
public IAsyncFluentCommand GetDocumentTitleCommand =>
Send<GetDocumentTitleQuery, string>()
.Then(title => DocumentTitle = title);
}
3. Define Commands and Queries
Implement CQRS handlers for Revit operations:
public class GetDocumentTitleQuery : IQuery<string>
{
}
public class GetDocumentTitleQueryHandler : IQueryHandler<GetDocumentTitleQuery, string>
{
private readonly RevitContext _revitContext;
public GetDocumentTitleQueryHandler(RevitContext revitContext)
{
_revitContext = revitContext;
}
public string Execute(GetDocumentTitleQuery query, CancellationToken cancellationToken)
{
return _revitContext.Document?.Title ?? "No document open";
}
}
4. Show the Main Window
Launch your application window:
WindowHandler.ShowWindow<MainWindow>(provider, IntPtr.Zero);
Resource Management
Apply global styles/resources in XAML:
<UserControl
resources:ResourceInjectionBehavior.InjectResources="True"
xmlns:resources="clr-namespace:RevitAppFramework.Resources">
</UserControl>
Versioning Support
- Set build configuration per Revit version (for example
Debug 2022) - Use conditional symbols for version-specific code (for example
#if R2022) - Reference version-specific Revit API assemblies through package configuration
Dependencies
- WPF-UI
- MVVMFluent.WPF
- Microsoft.Extensions.DependencyInjection
License
MIT License
For more information, visit Tools by AEC Wiki
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET Framework | net48 is compatible. net481 was computed. |
-
- MVVMFluent.WPF (>= 0.0.2)
- WPF-UI (>= 4.0.2)
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 |
|---|---|---|
| 26.7.0-PullRequest4.24 | 35 | 5/29/2026 |
| 26.7.0-PullRequest4.2 | 45 | 3/19/2026 |
| 26.7.0-beta.23 | 49 | 5/29/2026 |
| 26.7.0-beta.1 | 127 | 3/19/2026 |
| 26.6.1 | 171 | 3/2/2026 |
| 26.6.1-PullRequest3.5 | 29 | 3/2/2026 |
| 26.6.1-PullRequest3.4 | 28 | 3/2/2026 |
| 26.6.1-PullRequest3.3 | 33 | 3/2/2026 |
| 26.6.1-PullRequest3.2 | 26 | 3/2/2026 |
| 26.6.1-beta.4 | 125 | 3/2/2026 |
| 26.6.1-beta.3 | 124 | 3/2/2026 |
| 26.6.1-beta.2 | 124 | 3/2/2026 |
| 26.6.1-beta.1 | 126 | 3/2/2026 |
| 26.6.0 | 191 | 2/27/2026 |
| 26.5.9-PullRequest2.2 | 29 | 2/27/2026 |
| 26.5.8 | 170 | 2/26/2026 |
| 26.5.8-PullRequest1.3 | 27 | 2/26/2026 |
| 26.5.8-PullRequest1.2 | 29 | 2/26/2026 |
| 26.5.7 | 175 | 2/26/2026 |
| 26.5.6 | 177 | 2/26/2026 |