SmartDIContainer.cs
/// <summary>
/// Called by the deriver whenever a class is about to disappear from view. It is better to call this before the
/// finalizer, as that can be extremely late. An example would be Xamarin.Forms.ContentPage.OnDisappearing. Other
/// views or view models will have to listen to the original page event and then notify about their own demise. If
/// this step is skipped, none of the lifecycle protections will occur!
/// </summary>
/// <param name="containerObj">A variable that was inserted into the container "live" and is now being deactivated.</param>
/// <summary>
/// Called by the deriver whenever a class is about to disappear from view. It is better to call this before the
/// finalizer, as that can be extremely late. An example would be Xamarin.Forms.ContentPage.OnDisappearing. Other
/// views or view models will have to listen to the original page event and then notify about their own demise. If
/// this step is skipped, none of the lifecycle protections will occur!
/// </summary>
/// <param name="containerObj">The container object.</param>
/// <autogeneratedoc />
/// TODO Edit XML Comment Template for ContainerObjectIsDisappearing
Called by the deriver whenever a class is about to disappear from view. It is better to call this before the
finalizer, as that can be extremely late.
Called by the deriver whenever a class is about to disappear from view . It is better to call this before the finalizer as that can be extremely late .
public virtual void ContainerObjectIsDisappearing(object containerObj)
      {
         RemoveSingletonInstance(containerObj.GetType());
         RemoveSharedInstance(containerObj.GetType());
         RemoveBoundSharedDependencies(containerObj);
      }
public virtual void ContainerObjectIsDisappearing ( object containerObj ) { RemoveSingletonInstance ( containerObj . GetType ( ) ) ; RemoveSharedInstance ( containerObj . GetType ( ) ) ; RemoveBoundSharedDependencies ( containerObj ) ; }
Called by the deriver whenever a class is about to disappear from view.
Called by the deriver whenever a class is about to disappear from view .
// Remove the class from the global singletons // See if the shared instances contain the class. There are two possible scenarios: // 1. This class is the shared class. If so, we remove the entire node that contains the container class. // This only removes the object if it exists (its type is registered). // 2. This class is bound to a shared class. If true, we remove that single part of the node. However, if this //   is the last node, then we do as with #1 -- we kill the entire node.
containerObj
object
The container object.
The container object .
autogeneratedoc
None