Class SplatContainerExtension
A container for the Prism application.
public class SplatContainerExtension : IContainerExtension<IDependencyResolver>, IContainerExtension, IContainerProvider, IContainerRegistry, IDisposable
- Inheritance
-
SplatContainerExtension
- Implements
-
IContainerExtension<IDependencyResolver>IContainerExtensionIContainerProviderIContainerRegistry
- Extension Methods
Constructors
SplatContainerExtension()
Initializes a new instance of the SplatContainerExtension class.
public SplatContainerExtension()
Properties
CurrentScope
public IScopedProvider CurrentScope { get; }
Property Value
- IScopedProvider
Instance
Gets the dependency resolver.
public IDependencyResolver Instance { get; }
Property Value
Methods
CreateScope()
public IScopedProvider CreateScope()
Returns
- IScopedProvider
Dispose()
public void Dispose()
Dispose(bool)
Disposes data associated with the extension.
protected virtual void Dispose(bool isDisposing)
Parameters
isDisposing
boolIf we are getting called by the Dispose() method rather than a finalizer.
FinalizeExtension()
public void FinalizeExtension()
IsRegistered(Type)
public bool IsRegistered(Type type)
Parameters
type
Type
Returns
IsRegistered(Type, string)
public bool IsRegistered(Type type, string name)
Parameters
Returns
Register(Type, Func<IContainerProvider, object>)
public IContainerRegistry Register(Type type, Func<IContainerProvider, object> factoryMethod)
Parameters
Returns
- IContainerRegistry
Register(Type, Func<object>)
public IContainerRegistry Register(Type type, Func<object> factoryMethod)
Parameters
Returns
- IContainerRegistry
Register(Type, Type)
public IContainerRegistry Register(Type from, Type to)
Parameters
Returns
- IContainerRegistry
Register(Type, Type, Func<object>)
Registers an object with the default registration func.
public IContainerRegistry Register(Type from, Type to, Func<object> defaultCreationFunc)
Parameters
from
TypeThe type to transform from.
to
TypeThe type to transform to.
defaultCreationFunc
Func<object>A creation func for generating the type.
Returns
- IContainerRegistry
The container registry for builder operations.
Register(Type, Type, string)
public IContainerRegistry Register(Type from, Type to, string name)
Parameters
Returns
- IContainerRegistry
Register(Type, Type, string, Func<object>)
Registers an object with the default registration func.
public IContainerRegistry Register(Type from, Type to, string name, Func<object> defaultCreationFunc)
Parameters
from
TypeThe type to transform from.
to
TypeThe type to transform to.
name
stringThe contract name.
defaultCreationFunc
Func<object>A creation func for generating the type.
Returns
- IContainerRegistry
The container registry for builder operations.
RegisterInstance(Type, object)
public IContainerRegistry RegisterInstance(Type type, object instance)
Parameters
Returns
- IContainerRegistry
RegisterInstance(Type, object, string)
public IContainerRegistry RegisterInstance(Type type, object instance, string name)
Parameters
Returns
- IContainerRegistry
RegisterMany(Type, params Type[])
public IContainerRegistry RegisterMany(Type type, params Type[] serviceTypes)
Parameters
Returns
- IContainerRegistry
RegisterManySingleton(Type, params Type[])
public IContainerRegistry RegisterManySingleton(Type type, params Type[] serviceTypes)
Parameters
Returns
- IContainerRegistry
RegisterScoped(Type, Func<IContainerProvider, object>)
public IContainerRegistry RegisterScoped(Type type, Func<IContainerProvider, object> factoryMethod)
Parameters
Returns
- IContainerRegistry
RegisterScoped(Type, Func<object>)
public IContainerRegistry RegisterScoped(Type type, Func<object> factoryMethod)
Parameters
Returns
- IContainerRegistry
RegisterScoped(Type, Type)
public IContainerRegistry RegisterScoped(Type from, Type to)
Parameters
Returns
- IContainerRegistry
RegisterSingleton(Type, Func<IContainerProvider, object>)
public IContainerRegistry RegisterSingleton(Type type, Func<IContainerProvider, object> factoryMethod)
Parameters
Returns
- IContainerRegistry
RegisterSingleton(Type, Func<object>)
public IContainerRegistry RegisterSingleton(Type type, Func<object> factoryMethod)
Parameters
Returns
- IContainerRegistry
RegisterSingleton(Type, Type)
public IContainerRegistry RegisterSingleton(Type from, Type to)
Parameters
Returns
- IContainerRegistry
RegisterSingleton(Type, Type, Func<object>)
Registers an object with the default registration func.
public IContainerRegistry RegisterSingleton(Type from, Type to, Func<object> defaultCreationFunc)
Parameters
from
TypeThe type to transform from.
to
TypeThe type to transform to.
defaultCreationFunc
Func<object>A creation func for generating the type.
Returns
- IContainerRegistry
The container registry for builder operations.
RegisterSingleton(Type, Type, string)
public IContainerRegistry RegisterSingleton(Type from, Type to, string name)
Parameters
Returns
- IContainerRegistry
RegisterSingleton(Type, Type, string, Func<object>)
Registers an object with the default registration func.
public IContainerRegistry RegisterSingleton(Type from, Type to, string name, Func<object> defaultCreationFunc)
Parameters
from
TypeThe type to transform from.
to
TypeThe type to transform to.
name
stringThe contract name.
defaultCreationFunc
Func<object>A creation func for generating the type.
Returns
- IContainerRegistry
The container registry for builder operations.
Resolve(Type)
public object? Resolve(Type type)
Parameters
type
Type
Returns
Resolve(Type, string)
public object? Resolve(Type type, string name)
Parameters
Returns
Resolve(Type, string, params (Type Type, object Instance)[])
public object? Resolve(Type type, string name, params (Type Type, object Instance)[] parameters)
Parameters
Returns
Resolve(Type, params (Type Type, object Instance)[])
public object? Resolve(Type type, params (Type Type, object Instance)[] parameters)