Caliburn-Micro / Caliburn.Micro

A small, yet powerful framework, designed for building applications across all XAML platforms. Its strong support for MV* patterns will enable you to build your solution quickly, without the need to sacrifice code quality or testability.
http://caliburnmicro.com/
MIT License
2.8k stars 778 forks source link

feature request: add a registration and unregistration events to SimpleContainer and IoC. #695

Closed Aberro closed 4 years ago

Aberro commented 4 years ago

I'm sure that'll be quite easy and would allow scenarios with waiting services availability.

mvermef commented 4 years ago

SimpleContainer doesn't deal with events... What cases would this beneficial?

Aberro commented 4 years ago

It does "Activated" event on building an instance. These events are quite similar, but for registration and unregistration of services. I've been using mine implementation in fork (it wasn't as simple as I've initially though, but it take me ~15 minutes to implement) so I can react on new IoC services and await specific services availability in other services, especially singletons and single instances.

nigel-sampson commented 4 years ago

SimpleContainer was designed to be a simple stand in replacement for people wanting to do dependency injection without requiring a framework.

The intention is that if there were times when people wanted more complex behavior then I'd suggest using a fully fledged DI container such as Autofac.