CrissCross.WPF
2.5.4
dotnet add package CrissCross.WPF --version 2.5.4
NuGet\Install-Package CrissCross.WPF -Version 2.5.4
<PackageReference Include="CrissCross.WPF" Version="2.5.4" />
<PackageVersion Include="CrissCross.WPF" Version="2.5.4" />
<PackageReference Include="CrissCross.WPF" />
paket add CrissCross.WPF --version 2.5.4
#r "nuget: CrissCross.WPF, 2.5.4"
#:package CrissCross.WPF@2.5.4
#addin nuget:?package=CrissCross.WPF&version=2.5.4
#tool nuget:?package=CrissCross.WPF&version=2.5.4
CrissCross
A navigation framework and set of UI components for ReactiveUI-based applications across WPF, Avalonia, MAUI, and WinForms.
Overview
CrissCross provides ViewModel-first navigation, hostable navigation surfaces, and a comprehensive WPF UI control set with a strong ReactiveUI focus. It promotes:
- ViewModel-first navigation using ReactiveUI�s IViewFor and WhenActivated
- Host-based navigation via named ViewModelRoutedViewHost containers
- Consistent navigation lifecycle notifications (WhenNavigating/WhenNavigatedTo/From)
- Easy DI/IoC integration via Splat and Microsoft.Extensions.Hosting
- A large library of fluent WPF UI controls and services (dialogs, snackbars, themes)
Supported platforms and packages:
- Core: CrissCross (ReactiveUI helpers and navigation abstractions)
- WPF navigation host: CrissCross.WPF
- WPF UI control library: CrissCross.WPF.UI
- Avalonia host: CrissCross.Avalonia
- .NET MAUI helpers: CrissCross.MAUI
- WinForms host: CrissCross.WinForms
- WPF WebView2 overlay host: CrissCross.WPF.WebView2
- WPF Plot control suite: CrissCross.WPF.Plot
NuGet packages:
- CrissCross:
- WPF:
- WPF UI:
- Avalonia:
- MAUI:
- WinForms:
- WPF WebView2:
- WPF Plot:
Note: Xamarin.Forms support exists in separate projects but for new apps prefer .NET MAUI.
Core Concepts
CrissCross builds on ReactiveUI to provide ViewModel-first navigation:
- IRxObject: Base ViewModel type used throughout CrissCross
- IViewFor<TViewModel>: ReactiveUI contract mapping VMs to Views
- WhenActivated: ReactiveUI activation lifecycle for Views
- ViewModelRoutedViewHost: Navigation host control that manages a navigation stack and view transitions
- HostName: A host identifier (string) that allows targeting navigation to a specific host
- Navigation lifecycle: WhenNavigating, WhenNavigatedTo, WhenNavigatedFrom via mixins/events
Register your ViewModels and Views with Splat�s Locator or Microsoft.Extensions.DependencyInjection. CrissCross uses the locator to resolve Views for navigation targets.
Quick Start (WPF)
- Install packages
- CrissCross
- CrissCross.WPF
- CrissCross.WPF.UI (for controls/themes)
- Register ViewModels and Views
public class AppBootstrapper : RxObject
{
public AppBootstrapper()
{
this.BuildComplete(() =>
{
// Example VM/View registrations using Splat
Locator.CurrentMutable.RegisterConstant(new MainViewModel());
Locator.CurrentMutable.Register<IViewFor<MainViewModel>>(() => new MainView());
Locator.CurrentMutable.RegisterConstant(new FirstViewModel());
Locator.CurrentMutable.Register<IViewFor<FirstViewModel>>(() => new FirstView());
Locator.CurrentMutable.SetupComplete();
});
}
}
- Create a navigation host (NavigationWindow)
public partial class MainWindow : NavigationWindow<MainWindowViewModel>
{
public MainWindow()
{
InitializeComponent(); // Ensure x:Name is set on the Window (e.g., "mainWindow")
this.WhenActivated(d =>
{
// Bind back command, etc
NavBack.Command = ReactiveCommand.Create(() => this.NavigateBack(), CanNavigateBack).DisposeWith(d);
// Navigate to a start VM
this.NavigateToView<MainViewModel>();
});
}
}
- Navigate from a ViewModel
public class MainViewModel : RxObject
{
public MainViewModel()
{
this.BuildComplete(() =>
{
// Target a specific host by name (Window x:Name)
this.NavigateToView<FirstViewModel>("mainWindow");
});
}
}
- Create a View
public partial class MainView : ReactiveUserControl<MainViewModel>
{
public MainView()
{
InitializeComponent();
this.WhenActivated(_ => { /* bindings, commands */ });
}
}
Hosts and Navigation APIs
NavigationWindow (WPF): A Window that exposes a ViewModelRoutedViewHost and transition support
- Properties: Transition, NavigateBackIsEnabled
- Exposes CanNavigateBack observable and NavigateBack() helper
FluentNavigationWindow (WPF UI): A fluent-styled NavigationWindow with additional title content areas and Transition
NavigationUserControl (WPF UI, Avalonia): A hostable control version of the navigation container (for regions/panels)
ViewModelRoutedViewHost (WPF): Core host implementation
- Navigate<TViewModel>(contract, parameter)
- Navigate(IRxObject vm, contract, parameter)
- NavigateAndReset variants
- NavigateBack(parameter)
- CanNavigateBackObservable, NavigationStack
- Lifecycle events routed via ViewModelRoutedViewHostMixins:
- WhenNavigating: preview/cancel navigation
- WhenNavigatedTo/From: after navigation completes
HostName: Set on NavigationWindow/NavigationUserControl (typically from x:Name) to route cross-host navigation
Navigation from Views and ViewModels
- From code-behind: this.NavigateToView<TViewModel>(hostName?, parameter?)
- From ViewModel: this.NavigateToView<TViewModel>(hostName, parameter?)
- NavigateBack(hostName?, parameter?) and CanNavigateBack(hostName?) helpers
WPF UI Library (CrissCross.WPF.UI)
A comprehensive set of fluent controls and services designed for ReactiveUI apps. Highlights include:
- NavigationView, BreadcrumbBar and navigation controls/models
- Dialogs: ContentDialog, MessageBox, async variants
- Notifications: Snackbar, InfoBar, InfoBadge
- Input: AutoSuggestBox, NumberBox, PasswordBox, ToggleSwitch, TimePicker, DatePicker
- Lists and virtualization: ListView, VirtualizingGridView, VirtualizingWrapPanel
- Layout/containers: Card, CardExpander, GroupBox, Grid, StackPanel
- Media: GifImage (animation), Image
- PersonPicture, RatingControl, ProgressRing, AppBar, TitleBar, Window enhancements
- Color controls: ColorSelector suite (sliders, dual pickers), HexColorTextBox, and ColorPicker
- Typography and iconography: FontIcon, SymbolIcon, IconSource
- Themes and appearance utilities
Include the control resources by merging the ControlsDictionary:
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ui:ControlsDictionary />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
Theming and Appearance
- ApplicationThemeManager and SystemThemeWatcher for light/dark and system theme integration
- Resource dictionaries for typography, colors, focus, default styles
- ThemeService and IThemeService for programmatic control
Services
- ContentDialogService: Show dialogs and await results
- SnackbarService: Host snackbars with extension helpers
- PageService (WPF UI): Resolve pages by type for embedded/hosted scenarios
WPF Page Navigation (Host Builder)
For page-based apps using WPF UI, use the host builder extensions:
private static readonly IHost _host = Host.CreateDefaultBuilder()
.ConfigureCrissCrossForPageNavigation<MainWindow, DashboardPage>()
.ConfigureServices((context, services) =>
{
services.AddSingleton<MainWindowViewModel>();
services.AddSingleton<DashboardPage>().AddSingleton<DashboardViewModel>();
services.AddSingleton<DataPage>().AddSingleton<DataViewModel>();
services.AddSingleton<SettingsPage>().AddSingleton<SettingsViewModel>();
services.AddSingleton<LoginPage>().AddSingleton<LoginViewModel>();
})
.Build();
Wire up and start in App.xaml.cs, then navigate using IPageService or NavigationView.
NavigationView (WPF UI)
A powerful navigation control that manages a journal and hierarchical navigation stack:
- Navigate(Type pageType, object? dataContext)
- Navigate(string pageIdOrTargetTag, object? dataContext)
- NavigateWithHierarchy(Type pageType, object? dataContext)
- ReplaceContent(Type pageType) / ReplaceContent(UIElement)
- GoBack(), GoForward() (where implemented), ClearJournal()
- Events: Navigating (cancelable), Navigated, BackRequested, SelectionChanged, PaneOpened/Closed
The control maintains a NavigationStack and history so you can build rich shell navigation experiences.
Avalonia
- NavigationUserControl (host)
- ViewModelRoutedViewHost equivalent with CanNavigateBack observable and HostName
- Use ReactiveUI�s WhenActivated and Splat for registration as in WPF
public partial class MainUserControl : NavigationUserControl<MainWindowViewModel>
{
public MainUserControl()
{
InitializeComponent();
this.WhenActivated(d =>
{
this.NavigateToView<MainViewModel>();
_NavBack!.Command = ReactiveCommand.Create(() => this.NavigateBack(), this.CanNavigateBack()).DisposeWith(d);
});
}
}
.NET MAUI
MAUI helpers integrate with ReactiveUI.Maui. Register your VMs/Views with DI and navigate using the same NavigateToView/Back helpers where applicable. Prefer this approach over Xamarin.Forms for new apps.
Packages:
- CrissCross.MAUI
- ReactiveUI.Maui
WinForms
- ViewModelRoutedViewHost for WinForms
- ReactiveUserControl<TViewModel> usage with WhenActivated
- Navigate using the same helper mixins
WPF WebView2 Overlay Host
CrissCross.WPF.WebView2 provides a NavigationWebView that hosts WebView2 while allowing WPF content overlays:
xmlns:webv="https://github.com/reactivemarbles/CrissCross"
<webv:WebView2Wpf x:Name="WebView2Wpf" AutoDispose="True">
</webv:WebView2Wpf>
WebView2Wpf.Source = new Uri("https://www.reactiveui.net/");
WPF Plot (ScottPlot-based)
CrissCross.WPF.Plot adds Reactive plotting components:
- Bind reactive sequences
- Multiple series, Y-axes, crosshairs
- Zoom/pan, drag zoom selection
- Visibility toggles, auto/manual scale
Install: Install-Package CrissCross.WPF.Plot
Settings and Tracking (WPF UI)
Persist and track control/window state:
- Tracker service with attributes (Trackable, PersistOn, StopTrackingOn)
- Example usage in App.xaml.cs wiring window size/position persistence
_tracker?.Configure<MainWindow>()
.Id(w => w.Name, $"[Width={SystemParameters.VirtualScreenWidth},Height{SystemParameters.VirtualScreenHeight}]")
.Properties(w => new { w.Height, w.Width, w.Left, w.Top, w.WindowState })
.PersistOn(w => nameof(w.Closing))
.StopTrackingOn(w => nameof(w.Closing));
Color and Media Controls (WPF UI)
- ColorSelector suite (HSV/HSL/RGB sliders, square pickers, hex entry, dual color with hints)
- ColorPicker control: A simple RGBA + Hex picker with a live preview
- GifImage with animation control and performance-oriented decoding/animation components
Samples
- CrissCross.WPF.UI.Test: WPF UI test app with page navigation
- CrissCross.WPF.Test: WPF navigation sample
- CrissCross.Avalonia.Test.*: Avalonia samples (desktop, mobile)
- CrissCross.MAUI.Test: MAUI sample
- CrissCross.WPF.Plot.Test: Plot samples
- CrissCross.WPF.WebView2.Test: WebView2 overlay usage
- CrissCross.WPF.UI.Gallery: Control gallery showcasing WPF UI controls
Browse these projects to see real-world usage patterns, navigation setup, and control bindings.
Single Instance (WPF)
Prevent multiple instances using Make.SingleInstance in App:
protected override void OnStartup(StartupEventArgs e)
{
Make.SingleInstance("MyUniqueAppName ddd81fc8-9107-4e33-b848-cac4c3ec3d2a");
base.OnStartup(e);
}
Contributing
Issues and PRs are welcome. Please include platform, .NET version, and a minimal repro where applicable.
License
MIT � ReactiveUI Association Incorporated
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0-windows10.0.17763 is compatible. net9.0-windows was computed. net9.0-windows10.0.17763 is compatible. net10.0-windows was computed. |
.NET Framework | net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 is compatible. net48 is compatible. net481 was computed. |
-
.NETFramework 4.6.2
- CrissCross (>= 2.5.4)
- Microsoft.Web.WebView2 (>= 1.0.3405.78)
- ReactiveUI.WPF (>= 20.4.1)
-
.NETFramework 4.7.2
- CrissCross (>= 2.5.4)
- Microsoft.Web.WebView2 (>= 1.0.3405.78)
- ReactiveUI.WPF (>= 20.4.1)
-
.NETFramework 4.8
- CrissCross (>= 2.5.4)
- Microsoft.Web.WebView2 (>= 1.0.3405.78)
- ReactiveUI.WPF (>= 20.4.1)
-
net8.0-windows10.0.17763
- CrissCross (>= 2.5.4)
- Microsoft.Web.WebView2 (>= 1.0.3405.78)
- ReactiveUI.WPF (>= 20.4.1)
-
net9.0-windows10.0.17763
- CrissCross (>= 2.5.4)
- Microsoft.Web.WebView2 (>= 1.0.3405.78)
- ReactiveUI.WPF (>= 20.4.1)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on CrissCross.WPF:
Package | Downloads |
---|---|
CrissCross.WPF.UI
A Reactive Navigation Framework for ReactiveUI |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
2.5.4 | 116 | 9/2/2025 |
2.5.3 | 126 | 9/1/2025 |
2.5.2 | 245 | 6/24/2025 |
2.5.1 | 305 | 6/12/2025 |
2.5.0 | 130 | 5/31/2025 |
2.4.1 | 216 | 4/1/2025 |
2.4.0 | 189 | 4/1/2025 |
2.3.0 | 159 | 3/28/2025 |
2.2.8 | 173 | 3/16/2025 |
2.2.7 | 189 | 3/12/2025 |
2.2.6 | 168 | 2/19/2025 |
2.2.4 | 146 | 1/27/2025 |
2.2.3 | 125 | 1/14/2025 |
2.2.2 | 170 | 1/2/2025 |
2.2.1 | 182 | 11/25/2024 |
2.2.0 | 137 | 11/18/2024 |
2.1.3 | 174 | 11/7/2024 |
2.1.2 | 150 | 11/5/2024 |
2.1.1 | 156 | 11/5/2024 |
2.1.0 | 150 | 10/13/2024 |
2.0.6 | 206 | 8/2/2024 |
2.0.5 | 148 | 8/1/2024 |
2.0.4 | 124 | 7/31/2024 |
2.0.3 | 132 | 7/28/2024 |
2.0.2 | 140 | 7/25/2024 |
2.0.1 | 157 | 7/10/2024 |
2.0.0 | 183 | 5/18/2024 |
1.0.25 | 221 | 4/30/2024 |
1.0.24 | 167 | 4/19/2024 |
1.0.23 | 159 | 4/10/2024 |
1.0.22 | 150 | 3/29/2024 |
1.0.21 | 150 | 3/26/2024 |
1.0.20 | 181 | 3/22/2024 |
1.0.19 | 157 | 3/21/2024 |
1.0.18 | 180 | 3/19/2024 |
1.0.17 | 170 | 3/14/2024 |
1.0.16 | 169 | 3/13/2024 |
1.0.15 | 163 | 3/12/2024 |
1.0.14 | 159 | 3/11/2024 |
1.0.13 | 164 | 3/8/2024 |
1.0.12 | 161 | 3/7/2024 |
1.0.11 | 154 | 3/5/2024 |
1.0.10 | 168 | 2/22/2024 |
1.0.9 | 166 | 2/21/2024 |
1.0.8 | 166 | 2/21/2024 |
1.0.7 | 169 | 2/19/2024 |
1.0.6 | 162 | 2/16/2024 |
1.0.5 | 200 | 2/8/2024 |
1.0.4 | 273 | 1/4/2024 |
1.0.3 | 244 | 9/11/2023 |
1.0.2 | 199 | 9/9/2023 |
1.0.1 | 195 | 9/8/2023 |
1.0.0 | 184 | 9/7/2023 |
0.9.2 | 209 | 9/6/2023 |
0.9.1 | 229 | 8/6/2023 |
0.9.0 | 213 | 7/12/2023 |
0.8.0 | 216 | 6/23/2023 |
0.7.1 | 263 | 4/28/2023 |
0.7.0 | 285 | 3/14/2023 |
0.6.0 | 280 | 3/13/2023 |
0.5.0 | 273 | 3/11/2023 |
0.2.0 | 324 | 2/7/2023 |
0.1.0 | 343 | 1/7/2023 |
Compatability with Net 8/9 and netstandard2.0