You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In MvvmLight I can easily register a class in any of my projects, therefor I do not have a specific entry point to register a class.
SimpleIoc.Default.Register();
In the Toolkit.Mvvm I have a specific entry point.
Ioc.Default.ConfigureServices(
new ServiceCollection()
.AddSingleton()
.BuildServiceProvider());
Question 1
How can I reuse the existing ServerCollection in a different project and add more items (for registration) to it without resorting to constructor injection etc.
I ended up changing my code base to instantiate Ioc.Default.ConfigureServices() from the root app so I got everything working again, but this was a nice feature of MvvmLight where you can add more services from any project.
Question 2
With most templates in .NET starting to embrace the default asp.net core HostBuilder.
Is there plans to integrate toolkit.mvvm with the generic hostbuilder ?
example:
var host = new HostBuilder()
.ConfigureServices((c, x) =>
//Add this line to call back into your native code
AddToolkitMvvm(c, x);
})
.Build();
Where we can add the toolkit.mvvm to the generic host builder but still access the instances through the convenient
Ioc.Default.GetServices that is cross project instead of the default hostbuilder ServiceProvider.GetService();
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi Guys, @Sergio0694 , @michael-hawker
In MvvmLight I can easily register a class in any of my projects, therefor I do not have a specific entry point to register a class.
SimpleIoc.Default.Register();
In the Toolkit.Mvvm I have a specific entry point.
Ioc.Default.ConfigureServices(
new ServiceCollection()
.AddSingleton()
.BuildServiceProvider());
Question 1
How can I reuse the existing ServerCollection in a different project and add more items (for registration) to it without resorting to constructor injection etc.
I'm looking for something like :
Ioc.Default.ExistingService(
.AddSingleton()
.ReBuildServiceProvider());
I ended up changing my code base to instantiate Ioc.Default.ConfigureServices() from the root app so I got everything working again, but this was a nice feature of MvvmLight where you can add more services from any project.
Question 2
With most templates in .NET starting to embrace the default asp.net core HostBuilder.
Is there plans to integrate toolkit.mvvm with the generic hostbuilder ?
example:
var host = new HostBuilder()
.ConfigureServices((c, x) =>
//Add this line to call back into your native code
AddToolkitMvvm(c, x);
})
.Build();
Where we can add the toolkit.mvvm to the generic host builder but still access the instances through the convenient
Ioc.Default.GetServices that is cross project instead of the default hostbuilder ServiceProvider.GetService();
Beta Was this translation helpful? Give feedback.
All reactions