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
<PackageReference Include="Darkraise.Win32UI.Generators" Version="1.0.1" />
<PackageVersion Include="Darkraise.Win32UI.Generators" Version="1.0.1" />
<PackageReference Include="Darkraise.Win32UI.Generators" />
paket add Darkraise.Win32UI.Generators --version 1.0.1
#r "nuget: Darkraise.Win32UI.Generators, 1.0.1"
#:package Darkraise.Win32UI.Generators@1.0.1
#addin nuget:?package=Darkraise.Win32UI.Generators&version=1.0.1
#tool nuget:?package=Darkraise.Win32UI.Generators&version=1.0.1
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.
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.