Class Locator
- Namespace
- Splat
- Assembly
- Splat.dll
A Locator which will host the container for dependency injection based operations.
- Inheritance
-
Locator
Properties
Current
Gets the read only dependency resolver. This class is used throughout libraries for many internal operations as well as for general use by applications. If this isn't assigned on startup, a default, highly capable implementation will be used, and it is advised for most people to simply use the default implementation.
Property Value
- IReadonly
Dependency Resolver The dependency resolver.
CurrentMutable
Gets the mutable dependency resolver. The default resolver is also a mutable resolver, so this will be non-null. Use this to register new types on startup if you are using the default resolver.
Property Value
Methods
AreResolverCallbackChangedNotificationsEnabled()
Indicates if the we are notifying external classes of updates to the resolver being changed.
Returns
- bool
A value indicating whether the notifications are happening.
GetLocator()
Gets the full locator.
Note you should use Current or Current
Returns
- IDependency
Resolver The locator.
RegisterResolverCallbackChanged(Action)
This method allows libraries to register themselves to be set up whenever the dependency resolver changes. Applications should avoid this method, it is usually used for libraries that depend on service location.
Parameters
callback
ActionA callback that is invoked when the resolver is changed. This callback is also invoked immediately, to configure the current resolver.
Returns
- IDisposable
When disposed, removes the callback. You probably can ignore this.
SetLocator(IDependencyResolver)
Allows setting the dependency resolver.
Parameters
dependencyResolver
IDependencyResolver The dependency resolver to set.
SuppressResolverCallbackChangedNotifications()
This method will prevent resolver changed notifications from happening until the returned IDisposable is disposed.
Returns
- IDisposable
A disposable which when disposed will indicate the change notification is no longer needed.