GalaSoft.MvvmLight.Extras
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.
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.
This class' default instance.
This can be
used to bind any event on any FrameworkElement to an .
Typically, this element is used in XAML to connect the attached element
to a command located in a ViewModel. This trigger can only be attached
to a FrameworkElement or a class deriving from FrameworkElement.
To access the EventArgs of the fired event, use a RelayCommand<EventArgs>
and leave the CommandParameter and CommandParameterValue empty!
The dependency property's name.
Identifies the dependency property
Identifies the dependency property
Identifies the dependency property
Called when this trigger is attached to a FrameworkElement.
This method is here for compatibility
with the Silverlight 3 version.
The command that must be executed when
this trigger is invoked.
Identifies the dependency property.
Provides a simple way to invoke this trigger programatically
without any EventArgs.
Executes the trigger.
To access the EventArgs of the fired event, use a RelayCommand<EventArgs>
and leave the CommandParameter and CommandParameterValue empty!
The EventArgs of the fired event.
Gets or sets the ICommand that this trigger is bound to. This
is a DependencyProperty.
Gets or sets an object that will be passed to the
attached to this trigger. This is a DependencyProperty.
Gets or sets an object that will be passed to the
attached to this trigger. This property is here for compatibility
with the Silverlight version. This is NOT a DependencyProperty.
For databinding, use the property.
Gets or sets a value indicating whether the attached element must be
disabled when the property's CanExecuteChanged
event fires. If this property is true, and the command's CanExecute
method returns false, the element will be disabled. If this property
is false, the element will not be disabled when the command's
CanExecute method changes. This is a DependencyProperty.
Gets or sets a value indicating whether the attached element must be
disabled when the property's CanExecuteChanged
event fires. If this property is true, and the command's CanExecute
method returns false, the element will be disabled. This property is here for
compatibility with the Silverlight version. This is NOT a DependencyProperty.
For databinding, use the property.
Specifies whether the EventArgs of the event that triggered this
action should be passed to the bound RelayCommand. If this is true,
the command should accept arguments of the corresponding
type (for example RelayCommand<MouseButtonEventArgs>).
Gets or sets a converter used to convert the EventArgs when using
. If PassEventArgsToCommand is false,
this property is never used.
Gets or sets a parameters for the converter used to convert the EventArgs when using
. If PassEventArgsToCommand is false,
this property is never used. This is a dependency property.
The definition of the converter used to convert an EventArgs
in the class, if the
property is true.
Set an instance of this class to the
property of the EventToCommand instance.
The method used to convert the EventArgs instance.
An instance of EventArgs passed by the
event that the EventToCommand instance is handling.
An optional parameter used for the conversion. Use
the property
to set this value. This may be null.
The converted value.