RibbonControl.Persistence.Json
0.1.0-alpha.1
dotnet add package RibbonControl.Persistence.Json --version 0.1.0-alpha.1
NuGet\Install-Package RibbonControl.Persistence.Json -Version 0.1.0-alpha.1
<PackageReference Include="RibbonControl.Persistence.Json" Version="0.1.0-alpha.1" />
<PackageVersion Include="RibbonControl.Persistence.Json" Version="0.1.0-alpha.1" />
<PackageReference Include="RibbonControl.Persistence.Json" />
paket add RibbonControl.Persistence.Json --version 0.1.0-alpha.1
#r "nuget: RibbonControl.Persistence.Json, 0.1.0-alpha.1"
#:package RibbonControl.Persistence.Json@0.1.0-alpha.1
#addin nuget:?package=RibbonControl.Persistence.Json&version=0.1.0-alpha.1&prerelease
#tool nuget:?package=RibbonControl.Persistence.Json&version=0.1.0-alpha.1&prerelease
RibbonControl
Avalonia ribbon toolkit for desktop applications, with XAML-first composition, MVVM-friendly state flow, and optional JSON persistence for user customization state.
NuGet Packages
Documentation
Full project documentation is published with Lunet at wieslawsoltes.github.io/RibbonControl.
Features
- XAML-first, MVVM-first, and hybrid composition models.
- Rich ribbon primitives including tabs, groups, split buttons, combo boxes, toggle groups, galleries, backstage, and quick access toolbar.
- Data-driven composition with
RibbonDefinition,RibbonTab,RibbonGroup,RibbonItem, and matching definition/view-model types. - Merge-aware runtime composition through
TabsSource,GroupsSource,ItemsSource, andIRibbonMergePolicy. - Built-in key tip routing, adaptive layout, stable ribbon height support, and command-height synchronization.
- Runtime customization export/reset/load flows through
IRibbonCustomizationServiceandIRibbonStateStore. - JSON persistence package with schema versioning support and pluggable migrations.
- Automation peers, headless tests, visual regression coverage, and performance tests in the repository.
Installation
dotnet add package RibbonControl.Core
dotnet add package RibbonControl.Persistence.Json
Add the ribbon theme resources to your Avalonia app:
<Application xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="MyApp.App">
<Application.Styles>
<FluentTheme />
<StyleInclude Source="avares://RibbonControl.Core/Themes/Generic.axaml" />
</Application.Styles>
</Application>
Use the RibbonControl XML namespace in views:
xmlns:ribbon="https://github.com/wieslawsoltes/ribboncontrol"
Usage
XAML-First Composition
<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ribbon="https://github.com/wieslawsoltes/ribboncontrol">
<DockPanel>
<ribbon:Ribbon DockPanel.Dock="Top">
<ribbon:RibbonTab Id="home" Header="Home" Order="0">
<ribbon:RibbonGroup Id="clipboard" Header="Clipboard" Order="0">
<ribbon:RibbonItem Id="paste"
Label="Paste"
Primitive="PasteSplitButton"
IconPathData="{x:Static ribbon:FluentIconData.ClipboardPaste20Regular}"
ScreenTip="Paste from clipboard" />
<ribbon:RibbonItem Id="copy"
Label="Copy"
Primitive="Button"
IconPathData="{x:Static ribbon:FluentIconData.Copy20Regular}" />
</ribbon:RibbonGroup>
</ribbon:RibbonTab>
</ribbon:Ribbon>
</DockPanel>
</Window>
MVVM / Data-Driven Composition
Bind the control to view-model state and command services:
<ribbon:Ribbon TabsSource="{CompiledBinding Ribbon.Tabs}"
CommandCatalog="{CompiledBinding CommandCatalog}"
StateStore="{CompiledBinding StateStore}"
SelectedTabId="{CompiledBinding Ribbon.SelectedTabId, Mode=TwoWay}"
IsMinimized="{CompiledBinding Ribbon.IsMinimized, Mode=TwoWay}"
IsKeyTipMode="{CompiledBinding Ribbon.IsKeyTipMode, Mode=TwoWay}"
QuickAccessItems="{CompiledBinding QuickAccessItems}"
QuickAccessPlacement="{CompiledBinding QuickAccessPlacement, Mode=TwoWay}" />
Typical service setup:
using RibbonControl.Core.Models;
using RibbonControl.Core.Services;
using RibbonControl.Persistence.Json.Storage;
using RibbonControl.Core.ViewModels;
var commandCatalog = new DictionaryRibbonCommandCatalog();
var customizationService = new RibbonCustomizationService();
var stateStore = new JsonRibbonStateStore(
Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
"RibbonControl",
"ribbon-state.json"));
var ribbon = new RibbonViewModel();
var homeTab = new RibbonTabViewModel
{
Id = "home",
Header = "Home"
};
var clipboardGroup = new RibbonGroupViewModel
{
Id = "clipboard",
Header = "Clipboard"
};
clipboardGroup.ItemsViewModel.Add(new RibbonItemViewModel
{
Id = "paste",
Label = "Paste",
CommandId = "paste"
});
homeTab.GroupsViewModel.Add(clipboardGroup);
ribbon.Tabs.Add(homeTab);
Persistence
RibbonControl.Persistence.Json ships a file-based IRibbonStateStore implementation for saving and restoring RibbonRuntimeState.
using RibbonControl.Persistence.Json.Storage;
using RibbonControl.Persistence.Json.Storage.SampleMigrations;
var stateStore = new JsonRibbonStateStore(
"ribbon-state.json",
new JsonRibbonStateStoreOptions
{
CurrentSchemaVersion = 2,
Migrations =
{
new Schema1To2QuickAccessPlacementMigration()
}
});
Bind the store to Ribbon.StateStore, then use the built-in LoadStateCommand, SaveStateCommand, ResetStateCommand, and ResetCustomizationCommand commands exposed by the control.
Samples
| Project | Focus |
|---|---|
RibbonControl.Samples.XamlOnly |
Entire ribbon declared in XAML, including backstage and command presentation |
RibbonControl.Samples.MvvmOnly |
Ribbon generated from view-model state with two-way runtime synchronization |
RibbonControl.Samples.Hybrid |
Static shell in XAML with dynamic tabs, groups, and backstage content |
Architecture
The package split is intentionally small:
RibbonControl.Core: controls, themes, automation peers, runtime models, MVVM view models, merge logic, key tips, and state/customization services.RibbonControl.Persistence.Json: a file-basedIRibbonStateStoreimplementation with schema versioning and migration support.
Application code references RibbonControl.Core directly and adds RibbonControl.Persistence.Json when persistent ribbon state is required.
Build, Test, and Pack
dotnet restore RibbonControl.sln
dotnet build RibbonControl.sln -c Release
dotnet test RibbonControl.sln -c Release
dotnet pack src/RibbonControl.Core/RibbonControl.Core.csproj -c Release
dotnet pack src/RibbonControl.Persistence.Json/RibbonControl.Persistence.Json.csproj -c Release
The GitHub Actions setup includes:
CI: matrix build and test on macOS, Linux, and Windows, plus NuGet package artifact generation.Docs: Lunet build and GitHub Pages deployment from the default branch.Release: tag-driven package build, NuGet.org publish, symbol package upload, and GitHub release creation.
Create a tag such as v1.0.0 to publish a versioned release through the release workflow.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- RibbonControl.Core (>= 0.1.0-alpha.1)
-
net8.0
- RibbonControl.Core (>= 0.1.0-alpha.1)
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.1.0-alpha.1 | 37 | 3/10/2026 |