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
<PackageReference Include="MyNet.Xaml.Html" Version="7.0.0" />
<PackageVersion Include="MyNet.Xaml.Html" Version="7.0.0" />
<PackageReference Include="MyNet.Xaml.Html" />
paket add MyNet.Xaml.Html --version 7.0.0
#r "nuget: MyNet.Xaml.Html, 7.0.0"
#:package MyNet.Xaml.Html@7.0.0
#addin nuget:?package=MyNet.Xaml.Html&version=7.0.0
#tool nuget:?package=MyNet.Xaml.Html&version=7.0.0
<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>
XAML to HTML conversion utilities and helpers for cross-platform content rendering in .NET applications.
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
Related Packages
This package is part of the MyWpf collection:
- MyNet.Wpf - Core WPF library with controls and theming
- MyNet.Wpf.Presentation - MVVM presentation helpers
- MyNet.Wpf.LiveCharts - Data visualization components
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 | Versions 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. |
-
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.