XbfKit 0.1.1

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

<h1 align="center">XbfKit</h1> <p align="center">for decompiling and compiling versioned XBF documents.</p>

It supports XBF1 and XBF2/XBF2.1 documents, including the WUX and MUX dialects where applicable. The library exposes a semantic XAML object model so a document can be decompiled, edited, and recompiled.

Usage

<a style="text-decoration:none" href="https://www.nuget.org/packages/XbfKit"><img src="https://img.shields.io/nuget/v/XbfKit" alt="NuGet badge" /></a>

> dotnet add package XbfKit

using XbfKit;

const string xaml = "<Grid xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\" />";

using var xbf = new MemoryStream();
XbfCompiler.Compile(xaml, xbf, XbfVersion.Version2_1, XbfDialect.WUX);
xbf.Position = 0;

string decompiled = XbfDecompiler.Decompile(xbf, XbfDialect.WUX);

For a real file-to-file conversion, use the overload that accepts XbfCompilationOptions and the decompilation formatting options:

using XbfKit;

const string inputPath = "Page.xaml";
const string xbfPath = "Page.xbf";
const string outputPath = "Page.decompiled.xaml";

var compilationOptions = new XbfCompilationOptions
{
    Version = XbfVersion.Version2_1,
    Dialect = XbfDialect.WUX,
};

using (FileStream output = File.Create(xbfPath))
{
    XbfCompiler.Compile(File.ReadAllText(inputPath), output, compilationOptions);
}

var decompilationOptions = new XbfDecompilationOptions
{
    IndentSize = 2,
    IncludeConnectionIds = false,
    MaxAttributesPerLine = 2,
};

using FileStream input = File.OpenRead(xbfPath);
string decompiled = XbfDecompiler.Decompile(input, XbfDialect.WUX, decompilationOptions);
File.WriteAllText(outputPath, decompiled);

To access the validated in-memory representation directly, use the reader and writer in XbfKit.IO:

using XbfKit;
using XbfKit.IO;

XbfDocument document;
using (FileStream input = File.OpenRead("Page.xbf"))
{
    document = XbfDocumentReader.Read(input);
}

// Inspect or edit document.Metadata and document.Nodes here.

using FileStream output = File.Create("Page.copy.xbf");
XbfDocumentWriter.Write(document, output);

The supported format and dialect combinations are:

  • XBF1 with XbfDialect.WUX
  • XBF2 or XBF2.1 with XbfDialect.WUX or XbfDialect.MUX

WUX refers to Windows.UI.Xaml; MUX refers to Microsoft.UI.Xaml. The dialect must be supplied when decompiling because XBF2 does not retain enough information to distinguish those trusted framework schemas.

Product Compatible and additional computed target framework versions.
.NET 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.
  • net10.0

    • No dependencies.

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.1 110 9/9/2026
0.1.0 100 9/9/2026