C#/Prism

[Prism] Register

딸기우유중독 2023. 2. 7. 10:59
  • Register says that the given service should be used when the given interface is injected, and that a new instance will be created for each single injection.
  • RegisterSingleton differs in that the same instance is used for all injections.
  • RegisterInstance is the same as RegisterSingleton, but you have to provide an instance.
  •  

https://stackoverflow.com/questions/61023264/register-vs-registerinstance-vs-registersingleton-in-prism-7-di

 

Register vs RegisterInstance vs RegisterSingleton in Prism 7 DI

I am trying to register a service for DI in Prism 7. I find that all of the following methods work, which is the correct way to do it? What is the case for each? public class AndroidInitializer :

stackoverflow.com

 


 

 

 

728x90