LeXtudio.RichText 0.5.1

Prefix Reserved
dotnet add package LeXtudio.RichText --version 0.5.1
                    
NuGet\Install-Package LeXtudio.RichText -Version 0.5.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="LeXtudio.RichText" Version="0.5.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LeXtudio.RichText" Version="0.5.1" />
                    
Directory.Packages.props
<PackageReference Include="LeXtudio.RichText" />
                    
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 LeXtudio.RichText --version 0.5.1
                    
#r "nuget: LeXtudio.RichText, 0.5.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 LeXtudio.RichText@0.5.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=LeXtudio.RichText&version=0.5.1
                    
Install as a Cake Addin
#tool nuget:?package=LeXtudio.RichText&version=0.5.1
                    
Install as a Cake Tool

UnoRichText

UnoRichText is a rich text layout library for Uno Platform, providing RichTextBlock and the associated document model types that are missing or incomplete in Uno's current implementation.

It is backed by PretextSharp for cross-platform text measurement and layout, and mirrors the WinUI 3 / WPF namespace conventions so it can be used as a drop-in replacement with minimal code changes.

Why

Uno Platform's built-in RichTextBlock has several gaps:

  • Styling properties (FontFamily, FontSize, Foreground, etc.) are not applied.
  • InlineUIContainer — used to embed arbitrary UI elements inline with text — is not implemented.
  • Nested RichTextBlock inside containers (borders, grids, etc.) often renders no text at all.

UnoRichText replaces these types with a fully custom implementation that works correctly on all Uno Skia Desktop targets.

Supported Platforms

  • Windows 11 (Uno Skia Desktop)
  • macOS, 3 most recent versions
  • Ubuntu latest LTS (other Linux distributions may work but are not primary targets)

For support of additional platforms or business sponsorship enquiries, please reach out at lextudio.com.

Get Started

Install the NuGet package:

NuGet

dotnet add package LeXtudio.RichText

Provided types

Type Namespace
RichTextBlock LeXtudio.UI.Xaml.Controls
Paragraph System.Windows.Documents
InlineCollection System.Windows.Documents
Run System.Windows.Documents
Bold System.Windows.Documents
Italic System.Windows.Documents
Span System.Windows.Documents
Hyperlink System.Windows.Documents
LineBreak System.Windows.Documents
InlineUIContainer System.Windows.Documents

Usage

The API mirrors WinUI 3's RichTextBlock:

using LeXtudio.UI.Xaml.Controls;
using System.Windows.Documents;

var block = new RichTextBlock
{
    FontSize = 14,
    TextWrapping = TextWrapping.WrapWholeWords
};

var paragraph = new Paragraph();
paragraph.Inlines.Add(new Run { Text = "Hello, " });
paragraph.Inlines.Add(new Bold { Inlines = { new Run { Text = "world" } } });
block.Blocks.Add(paragraph);

Bridging from WinUI 3 code

If you have existing WinUI 3 code that uses the native RichTextBlock and related types, you can redirect unqualified names to UnoRichText on Uno targets using global using aliases in a single file:

#if !WINDOWS_APP_SDK
global using RichTextBlock     = LeXtudio.UI.Xaml.Controls.RichTextBlock;
global using InlineCollection  = System.Windows.Documents.InlineCollection;
global using Paragraph         = System.Windows.Documents.Paragraph;
global using Run               = System.Windows.Documents.Run;
global using Bold              = System.Windows.Documents.Bold;
global using Italic            = System.Windows.Documents.Italic;
global using Span              = System.Windows.Documents.Span;
global using LineBreak         = System.Windows.Documents.LineBreak;
global using InlineUIContainer = System.Windows.Documents.InlineUIContainer;
global using Hyperlink         = System.Windows.Documents.Hyperlink;
#endif

No other changes to the consuming code are needed.

License

MIT — see LICENSE.

Product Compatible and additional computed target framework versions.
.NET net10.0-desktop1.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.5.1 17 5/15/2026
0.5.0 21 5/15/2026
0.3.0 35 5/13/2026
0.2.0 48 5/13/2026
0.1.0 45 5/12/2026