MyNet.Xaml.Html 7.0.0

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

<div id="top"></div>

<br /> <div align="center"> <img src="../../assets/MyXaml.png" width="128" alt="MyXaml"> </div>

<h1 align="center">My .NET XAML to HTML</h1>

MIT License NuGet

XAML to HTML conversion utilities and helpers for cross-platform content rendering in .NET applications.

.NET 8.0 .NET 9.0 .NET 10.0 C#

Installation

Install via NuGet:

dotnet add package MyNet.Xaml.Html

Features

  • 🔄 XAML to HTML Conversion - Convert XAML content to HTML for web rendering
  • 🎨 Style Preservation - Maintain styling and formatting during conversion
  • 🌐 Cross-Platform Rendering - Enable XAML content display in web browsers
  • 📝 Rich Text Support - Handle complex XAML text formatting
  • 🔧 Extensible - Easy to customize and extend conversion logic

Usage

Basic XAML to HTML Conversion

using MyNet.Xaml.Html;

// Convert XAML string to HTML
string xamlContent = "<TextBlock>Hello World</TextBlock>";
string htmlContent = XamlToHtmlConverter.Convert(xamlContent);

Converting FlowDocument

// Convert a WPF FlowDocument to HTML
FlowDocument document = new FlowDocument();
document.Blocks.Add(new Paragraph(new Run("Sample text")));

string html = XamlToHtmlConverter.ConvertFlowDocument(document);

Advanced Conversion with Options

var options = new ConversionOptions
{
    PreserveWhitespace = true,
    IncludeStyles = true,
    CustomCssClasses = new Dictionary<string, string>()
};

string html = XamlToHtmlConverter.Convert(xamlContent, options);

Common Use Cases

  • Documentation Export - Convert rich text from WPF applications to HTML for web display
  • Content Management - Export XAML-based content to HTML for CMS integration
  • Reporting - Generate HTML reports from WPF FlowDocument content
  • Email Generation - Convert formatted XAML content to HTML emails
  • Cross-Platform Content - Display WPF content in web applications

This package is part of the MyWpf collection:

Contributing

Contributions are welcome! Please see the Contributing Guidelines for more information.

License

Copyright © 2016-2025 Stéphane ANDRE.

MyNet.Xaml.Html is provided as-is under the MIT license. For more information see LICENSE.

Product Compatible and additional computed target framework versions.
.NET net8.0-windows7.0 is compatible.  net9.0-windows was computed.  net9.0-windows7.0 is compatible.  net10.0-windows was computed.  net10.0-windows7.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0-windows7.0

    • No dependencies.
  • net8.0-windows7.0

    • No dependencies.
  • net9.0-windows7.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on MyNet.Xaml.Html:

Package Downloads
MyNet.Wpf

This library is a comprehensive class library designed to simplify the implementation of common GUI functionalities in .NET applications.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
7.0.0 125 10/17/2025
6.0.48 150 9/8/2025
6.0.16 68 9/6/2025
6.0.15 66 9/6/2025
6.0.12 65 9/6/2025
1.0.0 604 5/3/2024