View Locator
GodotViewLocator is the bridge between ReactiveUI's view resolution and Godot's PackedScene system. In Avalonia, IViewLocator is typically wired via XAML DataTemplates -- the platform inspects a ViewModel's type at binding time and instantiates the matching Control declared in XAML. Godot has no equivalent of DataTemplate-driven view resolution; scenes are loaded by GD.Load<PackedScene>(path).Instantiate(). GodotViewLocator provides that mapping manually: register a ViewModel type against a .tscn path, and ResolveView will load and instantiate the scene as an IViewFor<TViewModel>.
Registering GodotViewLocator into the Splat locator (as the Autoload does via .WithGodotViewLocator(...)) is optional. You can instead create one on demand wherever you need it -- for example var locator = new GodotViewLocator(); locator.RegisterView<MyView, MyViewModel>(...); -- and pass it directly to RoutedViewController / ItemsBinder. The Splat registration is only a convenience so that library components that resolve through Locator.Current can find a shared instance.
.WithGodotViewLocator(configure) registers the same instance as both IViewLocator and GodotViewLocator, so the locator resolved through Locator.Current is the same one your configure callback mutated. If you skip it, the default IViewLocator (ReactiveUI's DefaultViewLocator) remains in the container and GodotViewLocator is not registered at all.
Registration Methods
There are three ways to register views on a GodotViewLocator instance:
var locator = new GodotViewLocator();
// 1. Explicit, view + viewmodel types
locator.RegisterView<MyView, MyViewModel>("res://Views/MyView.tscn");
// or If you have GodotSharp.SourceGenerators installed
locator.RegisterView<MyView, MyViewModel>(MyView.TscnFilePath);
// 2. Only the viewmodel type ( viewType inferred from the IViewFor<T> implementation )
locator.RegisterView<MyViewModel>("res://Views/MyView.tscn");
// 3. Reflect the whole assembly -- picks up every concrete type implementing
// IViewFor<TViewModel> that also exposes a static TscnFilePath property.
locator.RegisterViewsFromAssemblyViaReflection(typeof(MyView).Assembly);Option 3 relies on the TscnFilePath static property generated by GodotSharp.SourceGenerators ([SceneTree]). That package is entirely optional -- options 1 and 2 accept a "res://..." path string directly and need no source generator. If you skip it, just call RegisterView(...) manually for each ViewModel/View pair; routing, ItemsBinder, and other view-resolution features work the same once the registrations are in place.
How Resolution Works
RegisterView<TViewModel>(path) only stores the ViewModel type and the .tscn path. At resolve time GodotViewLocator does GD.Load<PackedScene>(path).Instantiate<IViewFor<TViewModel>>() -- the actual view class is whatever the .tscn root script implements (it must implement IViewFor<TViewModel>). The <TView> type argument in RegisterView<TView, TViewModel>(...) is used only for compile-time validation and does not influence resolution.
ResolveView is normally called by ReactiveUI (or the sample RoutedViewController below) rather than your own code; you just keep the registrations up to date.