RibbonControl.Persistence.Json 0.1.0-alpha.1

This is a prerelease version of RibbonControl.Persistence.Json.
dotnet add package RibbonControl.Persistence.Json --version 0.1.0-alpha.1
                    
NuGet\Install-Package RibbonControl.Persistence.Json -Version 0.1.0-alpha.1
                    
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="RibbonControl.Persistence.Json" Version="0.1.0-alpha.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="RibbonControl.Persistence.Json" Version="0.1.0-alpha.1" />
                    
Directory.Packages.props
<PackageReference Include="RibbonControl.Persistence.Json" />
                    
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 RibbonControl.Persistence.Json --version 0.1.0-alpha.1
                    
#r "nuget: RibbonControl.Persistence.Json, 0.1.0-alpha.1"
                    
#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 RibbonControl.Persistence.Json@0.1.0-alpha.1
                    
#: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=RibbonControl.Persistence.Json&version=0.1.0-alpha.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=RibbonControl.Persistence.Json&version=0.1.0-alpha.1&prerelease
                    
Install as a Cake Tool

RibbonControl

Avalonia ribbon toolkit for desktop applications, with XAML-first composition, MVVM-friendly state flow, and optional JSON persistence for user customization state.

CI Docs RibbonControl.Core RibbonControl.Persistence.Json .NET Avalonia License: MIT

NuGet Packages

Package NuGet Description
RibbonControl.Core NuGet Core Avalonia ribbon controls, themes, models, view models, automation peers, merge policies, and command/state services
RibbonControl.Persistence.Json NuGet JSON-backed IRibbonStateStore implementation with schema versioning and migration hooks

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, and IRibbonMergePolicy.
  • Built-in key tip routing, adaptive layout, stable ribbon height support, and command-height synchronization.
  • Runtime customization export/reset/load flows through IRibbonCustomizationService and IRibbonStateStore.
  • 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-based IRibbonStateStore implementation 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 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. 
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.1.0-alpha.1 37 3/10/2026