Skip to content
Discussion options

You must be logged in to vote

In current ReactiveUI.SourceGenerators, [IViewFor<T>] only writes the ViewModel property and the IViewFor<T> members. View registration is done by the ReactiveUI.Binding view locator at build time. RegistrationType, ViewModelRegistrationType and RegisterViewsForViewModelsSourceGenerated() no longer exist, and the attribute does not register the view model.

Register the view model with Splat.DI.SourceGenerator yourself, for example SplatRegistrations.Register<MyCustomViewModel>() or RegisterLazySingleton<MyCustomViewModel>(), next to RegisterLazySingleton<IMyService, MyService>(). The generator resolves constructor parameters of every registered type (README, "Constructor Injection"), so I…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by 8alex62
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants