A compatibility library providing WPF namespace shims for the Uno Platform, enabling straightforward porting of WPF code without source modification.
LeXtudio.Windows implements portable equivalents of WPF types from System.Windows.*, System.Windows.Media.*, and System.Windows.Documents.* namespaces. These shims allow WPF-based libraries to compile and run on Uno Platform (both Uno Desktop and WinUI 3) with minimal code changes.
When porting a WPF library to Uno Platform, you typically face a choice:
- Modify all source files to remove WPF dependencies
- Use compatibility shims to maintain the original surface
This library chooses option 2. By providing stub implementations of common WPF types, it lets you keep your source code structure intact while running on Uno/WinUI targets.
dotnet add package LeXtudio.WindowsOr via NuGet Package Manager:
Install-Package LeXtudio.Windows
- Uno Platform (net9.0-desktop): Linux, macOS, iOS, Android
- WinUI 3 (net9.0-windows10.0.19041.0): Windows 10+
- WPF-compatible core types and runtime helpers including
DependencyObject,FrameworkElement,DependencyProperty,RoutedEvent,RoutedCommand, andIWeakEventListener - Clipboard and input support via
DataObject,DataFormats,Keyboard,Mouse,CommandBinding, andIInputElement - Platform-friendly helpers such as
Dispatcher,SystemFonts,SystemColors,FocusManager, andInputLanguageManager
- WinUI-backed media helpers for
Brushes,Colors,ImageSource,Pen, andMatrix - Text layout and formatting support with
Typeface,FormattedText,DrawingContext,CompositionTarget, andNumberSubstitution - Rich text styling via
TextDecorations,TextDecorationCollection,TextEffect, and text formatting helpers
- Rich document model elements like
FlowDocument,Paragraph,Run,Span,Hyperlink, andTable - Editing and selection types including
TextRange,TextPointer,TextSelection,TextElement,TextContainer,List, andListItem - Serialization and document interoperability helpers for XAML/RTF scenarios
- XAML serialization helpers such as
XamlReader,XamlWriter, andXamlDesignerSerializationManager - Control shims and bridge extensions including
RichTextBox,TextBlockextensions,Image,PanelShims, and WinUI interoperability helpers
For a WPF-based library, no changes needed:
using System.Windows;
using System.Windows.Media;
public class TextFormatter
{
public void Format()
{
var family = new FontFamily("Consolas");
var weight = FontWeight.Bold;
var style = FontStyle.Italic;
// Code works on WPF, Uno Desktop, and WinUI 3
}
}The library automatically provides the correct implementation for your target platform:
- On Uno Desktop, shims provide minimal functionality matching WPF surface
- On WinUI 3, shims align with WinUI equivalents
- Target Frameworks:
net9.0-desktop(Uno) andnet9.0-windows10.0.19041.0(WinUI) - Nullable: Disabled for broader compatibility with older WPF libraries
- Documentation: Includes XML docs for all public types
- License: MIT
These are compatibility shims, not full WPF reimplementations. They provide:
- Type definitions matching WPF's public surface
- Core properties and behaviors
- Minimal computation where needed (e.g., FontWeight conversions)
They do not provide:
- Full rendering pipelines
- Advanced typography features
- Performance optimizations matched to native platforms
For complex text layout or specialized rendering, defer to platform-specific APIs once shims are loaded.
- UnoRichText — Cross platform rich text controls. Ported from RichTextBox (WPF).
- UnoEdit — Code editor for Uno Platform and WinUI. Ported from AvalonEdit (WPF).
MIT — See LICENSE file in the repository.
Found an issue or missing type? Contributions welcome! Please file an issue or submit a PR to the this repo repository.