Darkraise.Win32UI.Generators 1.0.1

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

Darkraise.Win32UI.Generators

The Roslyn source generator behind Darkraise.Win32UI markup. It compiles .drui and .draml XML view files into C# control trees at build time, so markup views cost nothing at runtime: no XML parsing, no reflection, no trimmer roots.

dotnet add package Darkraise.Win32UI.Generators

This package ships as an analyzer. It contributes no runtime assembly and no dependencies of its own.

Usage

Add the package, then hand your markup files to the compiler as AdditionalFiles:

<ItemGroup>
  <AdditionalFiles Include="**/*.drui" />
  <AdditionalFiles Include="**/*.draml" />
</ItemGroup>

A view file names its view model and describes the control tree:

<?xml version="1.0" encoding="utf-8"?>
<View ViewModel="HelloApp.ViewModels.SignInViewModel">
  <Stack Gap="Md">
    <Label Text="Sign in" FontSize="Lg" Bold="true" />
    <TextBox Text="{Bind UserName}" Placeholder="User name" Width="240" />
    <CheckBox Text="Remember me" IsChecked="{Bind RememberMe}" />
    <Divider />
    <Button Text="Sign in" Variant="Primary" Command="SignInCommand" />
  </Stack>
</View>

DruiSchema.xsd ships in the package's content folder for editor validation and IntelliSense over your markup.

The generator emits a ViewBase<TViewModel> partial for each file, with bindings and command wiring resolved against the real view model type — a renamed or mistyped property is a compile error, not a silent runtime no-op.

.draml files can also be parsed at runtime with DramlView.LoadFile when you want views to be editable data rather than compiled code. Files loaded that way are Content, not AdditionalFiles.

Diagnostics

Rule Meaning
DRUI001 XML parse failure in a view file
DRUI002 Unknown element
DRUI003 Missing required attribute
DRUI004 View declares no root control
DRUI005 Unknown attribute
DRUI006 View model type not found
DRUI007 View model property not found
DRUI008 Feature not supported in compiled views
DRUI009 Invalid attribute value
DRUI010 Attribute does not support {Bind}
DRUI011 CommandParameter without Command
DRUI012 View model does not derive from DarkraiseScreen
DRUI013 Invalid element content
DRUI014 Command property is not an ICommand

The package also carries DRUI020, an analyzer that flags hardcoded theme literals — colors, font families, radii, padding and gap values, font weights, font sizes and durations — written directly into source under a Controls/ or Builder/ folder, where they should resolve from theme tokens instead. It is scoped to those folders and stays quiet everywhere else.

Requirements

Targets netstandard2.0, as Roslyn components must. Consuming projects need the .NET 10 SDK and a reference to Darkraise.Win32UI.

License

MIT. See LICENSE.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has 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
1.0.1 128 8/15/2026
1.0.0 89 8/15/2026