Nukepayload2.SourceGenerators.AvaloniaUI 1.0.0

dotnet add package Nukepayload2.SourceGenerators.AvaloniaUI --version 1.0.0
NuGet\Install-Package Nukepayload2.SourceGenerators.AvaloniaUI -Version 1.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="Nukepayload2.SourceGenerators.AvaloniaUI" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Nukepayload2.SourceGenerators.AvaloniaUI --version 1.0.0
#r "nuget: Nukepayload2.SourceGenerators.AvaloniaUI, 1.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.
// Install Nukepayload2.SourceGenerators.AvaloniaUI as a Cake Addin
#addin nuget:?package=Nukepayload2.SourceGenerators.AvaloniaUI&version=1.0.0

// Install Nukepayload2.SourceGenerators.AvaloniaUI as a Cake Tool
#tool nuget:?package=Nukepayload2.SourceGenerators.AvaloniaUI&version=1.0.0

Nukepayload2.SourceGenerators.AvaloniaUI

This is a Visual Basic SourceGenerator built for generating strongly-typed references to controls with x:Name (or just Name) attributes declared in XAML (or, in .axaml). The source generator will look for the xaml (or axaml) file with the same name as your partial Visual Basic class that is a subclass of Avalonia.INamed and parses the XAML markup, finds all XAML tags with x:Name attributes and generates the Visual Basic code.

Get on NuGet

NuGet version (Nukepayload2.SourceGenerators.AvaloniaUI)

VB-specific features

  • WithEvents members: allows you to attach events or locate event handlers with the drop-down button of Visual Basic code editor.
  • DesignerGenerated attribute: Let the Visual Basic compiler and editor call InitializeComponents for you.

System requirements

Minimum requirements

  • Visual Studio 16.9 or later
  • .NET SDK 6.0 or later

Highest tested environment

  • Visual Studio 17.9.0
  • .NET SDK 8.0
  • Windows 11 23H2

Avalonia compatibility

Package 1.0.0 and its prerelease versions

It's guaranteed to be compatible with 11.0.9. Other versions may work, but they are not tested.

How to use it

Install the Nukepayload2.SourceGenerators.AvaloniaUI package to a VB Avalonia project.

You can use demo projects as your project template collection. If you need to create a new project, just copy a demo project to your solution, then install the Nukepayload2.SourceGenerators.AvaloniaUI package.

Progress

  • Convert C# generator to VB
  • Basic manual testing (tested with 11.0.9)
    • InitializeComponents is working
    • DesignerGenerated (automatic InitializeComponents call) is working
    • x:NameWithEvents is working
  • Add demo projects
    • Port Mvvm samples
      • BasicMvvm
      • CommandSample
      • ValidationSample
      • ValueConversionSample
    • Port CustomControls samples
      • RatingControlSample
    • Port DataTemplates samples
      • BasicDataTemplateSample
      • FuncDataTemplateSample
      • IDataTemplateSample
    • Port Drawing samples
      • BattleCity
    • Port Routing samples
      • BasicViewLocatorSample
    • Port ViewInteraction samples
      • DialogManagerSample
      • MvvmDialogSample
    • Port Testing samples
      • TestableApp
      • TestableApp.Appium
      • TestableApp.Headless.NUnit
      • TestableApp.Headless.XUnit
    • Add VB-specific samples for testing purpose
      • Generate WithEvents by using x:Name in XAML
      • The InitializeComponents method can be automatically called by the VB compiler
      • x:FieldModifier: Make generated element references Public, Friend, Protected or Private. Friend is the default value.
      • A project that uses the NuGet package of source generator instead of project reference
  • Release NuGet package
    • Prerelease package when basic manual testing is completed
    • Publish stable release when all demos are working correctly

References

Embedded 3rd-party components:

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

  • .NETStandard 2.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
1.0.0 161 2/21/2024
1.0.0-beta05 147 2/20/2024

Support Avalonia 11.0.9