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.
The VB template pack has been released! It uses this source generator in project templates.
WithEventsmembers: allows you to attach events or locate event handlers with the drop-down button of Visual Basic code editor.DesignerGeneratedattribute: Let the Visual Basic compiler and editor callInitializeComponentsfor you.
- Visual Studio 16.9 or later
- .NET SDK 6.0 or later
- Visual Studio 17.12.0
- .NET SDK 9.0
- Windows 11 24H2
11.0.9
11.2.0
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.
- Convert C# generator to VB
- Basic manual testing (tested with 11.0.9)
-
InitializeComponentsis working -
DesignerGenerated(automaticInitializeComponentscall) is working -
x:Name->WithEventsis 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
WithEventsby usingx:Namein XAML - The
InitializeComponentsmethod can be automatically called by the VB compiler - x:FieldModifier: Make generated element references
Public,Friend,ProtectedorPrivate.Friendis the default value. - A project that uses the NuGet package of source generator instead of project reference
- Generate
- Port Mvvm samples
- Release NuGet package
- Prerelease package when basic manual testing is completed
- Publish stable release when all demos are working correctly
Embedded 3rd-party components: