Open
Description
Is it possible to use SplatRegistrations like this?
It says:
ViewModelLocator.cs(64, 9): [SPLATDI001] TConcrete has more than one constructor and one hasn't been marked with DependencyInjectionConstructorAttribute
public static void RegisterWithDesign<TInterface, TDesign>(this IMutableDependencyResolver resolver)
where TDesign : TInterface, new() => RegisterWithDesign<TInterface, TInterface, TDesign>(resolver);
public static void RegisterWithDesign<TInterface, TConcrete, TDesign>(this IMutableDependencyResolver resolver)
where TDesign : TInterface, new()
{
SplatRegistrations.Register<TInterface, TConcrete>("Init");
resolver.Register<TInterface>(() =>
Design.IsDesignMode ? new TDesign() : Locator.Current.GetService<TInterface>("Init"));
}
If not; it could be a neat feature to add.
Metadata
Metadata
Assignees
Labels
No labels