Open Haukinger opened 4 years ago
Can you pass in a subclass of ApplicationOptions to the ctor?
This works, actually, but the code looks rather ugly.
I've made the derived options type that gets all the dependencies a nested class in my urho application, and the attached property that calls UrhoSurface.Show
uses the common service locator to create the options instance.
The
Urho.Extensions.WinForms.UrhoSurface
usesActivator.CreateInstance
to produce the application instance inShow
. This means that one cannot inject any dependencies and has to resort to some static service locator.It would be cool if there was a
Show
overload that took aFunc<ApplicationOptions, Application>
to produce the application instance which could be made to redirect to the dependency injection container in use.