Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

Sometimes scoping is important to share an object inside a specific scope which cannot be determined upfront. A great example is the serialization inside Catel which requires a serialization scope which can be shared over a lot of objects. Scoping in Catel is really. To create a scope of an object with a specific tag, use the code below:

using (var scopeManager = ScopeManager<object>.GetScopeManager("object"))
{
    var scopeObject = scopeManager.ScopeObject;
 
    // scope can be used here
}

When the scope does not yet exist, it will be created and the object will be created by the TypeFactory.

  • No labels