GalaSoft.MvvmLight.Extras
Helper class for platform detection.
A very simple IOC container with basic functionality needed to register and resolve
instances. If needed, this class can be replaced by another more elaborate
IOC container implementing the IServiceLocator interface.
The inspiration for this class is at https://gist.github.com/716137 but it has
been extended with additional features.
Checks whether at least one instance of a given class is already created in the container.
The class that is queried.
True if at least on instance of the class is already created, false otherwise.
Checks whether the instance with the given key is already created for a given class
in the container.
The class that is queried.
The key that is queried.
True if the instance with the given key is already registered for the given class,
false otherwise.
Gets a value indicating whether a given type T is already registered.
The type that the method checks for.
True if the type is registered, false otherwise.
Gets a value indicating whether a given type T and a give key
are already registered.
The type that the method checks for.
The key that the method checks for.
True if the type and key are registered, false otherwise.
Registers a given type for a given interface.
The interface for which instances will be resolved.
The type that must be used to create instances.
Registers a given type for a given interface with the possibility for immediate
creation of the instance.
The interface for which instances will be resolved.
The type that must be used to create instances.
If true, forces the creation of the default
instance of the provided class.
Registers a given type.
The type that must be used to create instances.
Registers a given type with the possibility for immediate
creation of the instance.
The type that must be used to create instances.
If true, forces the creation of the default
instance of the provided class.
Registers a given instance for a given type.
The type that is being registered.
The factory method able to create the instance that
must be returned when the given type is resolved.
Registers a given instance for a given type with the possibility for immediate
creation of the instance.
The type that is being registered.
The factory method able to create the instance that
must be returned when the given type is resolved.
If true, forces the creation of the default
instance of the provided class.
Registers a given instance for a given type and a given key.
The type that is being registered.
The factory method able to create the instance that
must be returned when the given type is resolved.
The key for which the given instance is registered.
Registers a given instance for a given type and a given key with the possibility for immediate
creation of the instance.
The type that is being registered.
The factory method able to create the instance that
must be returned when the given type is resolved.
The key for which the given instance is registered.
If true, forces the creation of the default
instance of the provided class.
Resets the instance in its original states. This deletes all the
registrations.
Unregisters a class from the cache and removes all the previously
created instances.
The class that must be removed.
Removes the given instance from the cache. The class itself remains
registered and can be used to create other instances.
The type of the instance to be removed.
The instance that must be removed.
Removes the instance corresponding to the given key from the cache. The class itself remains
registered and can be used to create other instances.
The type of the instance to be removed.
The key corresponding to the instance that must be removed.
When used with the SimpleIoc container, specifies which constructor
should be used to instantiate when GetInstance is called.
If there is only one constructor in the class, this attribute is
not needed.
A very simple IOC container with basic functionality needed to register and resolve
instances. If needed, this class can be replaced by another more elaborate
IOC container implementing the IServiceLocator interface.
The inspiration for this class is at https://gist.github.com/716137 but it has
been extended with additional features.
This class' default instance.
Checks whether at least one instance of a given class is already created in the container.
The class that is queried.
True if at least on instance of the class is already created, false otherwise.
Checks whether the instance with the given key is already created for a given class
in the container.
The class that is queried.
The key that is queried.
True if the instance with the given key is already registered for the given class,
false otherwise.
Gets a value indicating whether a given type T is already registered.
The type that the method checks for.
True if the type is registered, false otherwise.
Gets a value indicating whether a given type T and a give key
are already registered.
The type that the method checks for.
The key that the method checks for.
True if the type and key are registered, false otherwise.
Registers a given type for a given interface.
The interface for which instances will be resolved.
The type that must be used to create instances.
Registers a given type for a given interface with the possibility for immediate
creation of the instance.
The interface for which instances will be resolved.
The type that must be used to create instances.
If true, forces the creation of the default
instance of the provided class.
Registers a given type.
The type that must be used to create instances.
Registers a given type with the possibility for immediate
creation of the instance.
The type that must be used to create instances.
If true, forces the creation of the default
instance of the provided class.
Registers a given instance for a given type.
The type that is being registered.
The factory method able to create the instance that
must be returned when the given type is resolved.
Registers a given instance for a given type with the possibility for immediate
creation of the instance.
The type that is being registered.
The factory method able to create the instance that
must be returned when the given type is resolved.
If true, forces the creation of the default
instance of the provided class.
Registers a given instance for a given type and a given key.
The type that is being registered.
The factory method able to create the instance that
must be returned when the given type is resolved.
The key for which the given instance is registered.
Registers a given instance for a given type and a given key with the possibility for immediate
creation of the instance.
The type that is being registered.
The factory method able to create the instance that
must be returned when the given type is resolved.
The key for which the given instance is registered.
If true, forces the creation of the default
instance of the provided class.
Resets the instance in its original states. This deletes all the
registrations.
Unregisters a class from the cache and removes all the previously
created instances.
The class that must be removed.
Removes the given instance from the cache. The class itself remains
registered and can be used to create other instances.
The type of the instance to be removed.
The instance that must be removed.
Removes the instance corresponding to the given key from the cache. The class itself remains
registered and can be used to create other instances.
The type of the instance to be removed.
The key corresponding to the instance that must be removed.
Provides a way to get all the created instances of a given type available in the
cache. Registering a class or a factory does not automatically
create the corresponding instance! To create an instance, either register
the class or the factory with createInstanceImmediately set to true,
or call the GetInstance method before calling GetAllCreatedInstances.
Alternatively, use the GetAllInstances method, which auto-creates default
instances for all registered classes.
The class of which all instances
must be returned.
All the already created instances of the given type.
Provides a way to get all the created instances of a given type available in the
cache. Registering a class or a factory does not automatically
create the corresponding instance! To create an instance, either register
the class or the factory with createInstanceImmediately set to true,
or call the GetInstance method before calling GetAllCreatedInstances.
Alternatively, use the GetAllInstances method, which auto-creates default
instances for all registered classes.
The class of which all instances
must be returned.
All the already created instances of the given type.
Gets the service object of the specified type.
If the type serviceType has not
been registered before calling this method.
A service object of type .
An object that specifies the type of service object to get.
Provides a way to get all the created instances of a given type available in the
cache. Calling this method auto-creates default
instances for all registered classes.
The class of which all instances
must be returned.
All the instances of the given type.
Provides a way to get all the created instances of a given type available in the
cache. Calling this method auto-creates default
instances for all registered classes.
The class of which all instances
must be returned.
All the instances of the given type.
Provides a way to get an instance of a given type. If no instance had been instantiated
before, a new instance will be created. If an instance had already
been created, that same instance will be returned.
If the type serviceType has not
been registered before calling this method.
The class of which an instance
must be returned.
An instance of the given type.
Provides a way to get an instance of a given type. This method
always returns a new instance and doesn't cache it in the IOC container.
If the type serviceType has not
been registered before calling this method.
The class of which an instance
must be returned.
An instance of the given type.
Provides a way to get an instance of a given type corresponding
to a given key. If no instance had been instantiated with this
key before, a new instance will be created. If an instance had already
been created with the same key, that same instance will be returned.
If the type serviceType has not
been registered before calling this method.
The class of which an instance must be returned.
The key uniquely identifying this instance.
An instance corresponding to the given type and key.
Provides a way to get an instance of a given type. This method
always returns a new instance and doesn't cache it in the IOC container.
If the type serviceType has not
been registered before calling this method.
The class of which an instance must be returned.
The key uniquely identifying this instance.
An instance corresponding to the given type and key.
Provides a way to get an instance of a given type. If no instance had been instantiated
before, a new instance will be created. If an instance had already
been created, that same instance will be returned.
If the type TService has not
been registered before calling this method.
The class of which an instance
must be returned.
An instance of the given type.
Provides a way to get an instance of a given type. This method
always returns a new instance and doesn't cache it in the IOC container.
If the type TService has not
been registered before calling this method.
The class of which an instance
must be returned.
An instance of the given type.
Provides a way to get an instance of a given type corresponding
to a given key. If no instance had been instantiated with this
key before, a new instance will be created. If an instance had already
been created with the same key, that same instance will be returned.
If the type TService has not
been registered before calling this method.
The class of which an instance must be returned.
The key uniquely identifying this instance.
An instance corresponding to the given type and key.
Provides a way to get an instance of a given type. This method
always returns a new instance and doesn't cache it in the IOC container.
If the type TService has not
been registered before calling this method.
The class of which an instance must be returned.
The key uniquely identifying this instance.
An instance corresponding to the given type and key.