Bagikan melalui


ContextItemManager Class

Maintains a set of context items.

Inheritance Hierarchy

System.Object
  Microsoft.Windows.Design.ContextItemManager

Namespace:  Microsoft.Windows.Design
Assembly:  Microsoft.Windows.Design.Extensibility (in Microsoft.Windows.Design.Extensibility.dll)

Syntax

'Declaration
Public MustInherit Class ContextItemManager _
    Implements IEnumerable(Of ContextItem), IEnumerable
public abstract class ContextItemManager : IEnumerable<ContextItem>, 
    IEnumerable
public ref class ContextItemManager abstract : IEnumerable<ContextItem^>, 
    IEnumerable
[<AbstractClass>]
type ContextItemManager =  
    class
        interface IEnumerable<ContextItem>
        interface IEnumerable
    end
public abstract class ContextItemManager implements IEnumerable<ContextItem>, IEnumerable

The ContextItemManager type exposes the following members.

Constructors

  Name Description
Protected method ContextItemManager Initializes a new instance of the ContextItemManager class.

Top

Methods

  Name Description
Public method Contains(Type) When overridden in a derived class, returns a value indicating whether the context item manager contains an item of the specified type.
Public method Contains<TItemType>() Returns a value indicating whether the context item manager contains an item of the specified type.
Public method Equals Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetEnumerator When overridden in a derived class, gets an enumeration of context items in the editing context.
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Protected methodStatic member GetTarget A utility method that returns the target object for a delegate.
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Public method GetValue(Type) When overridden in a derived class, returns an instance of the requested item type.
Public method GetValue<TItemType>() Returns an instance of the requested item type.
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Protected methodStatic member NotifyItemChanged Invokes the protected OnItemChanged method on the specified ContextItem.
Protected methodStatic member RemoveCallback A helper method that performs a Delegate.Remove, but knows how to unwrap delegates that are proxies to generic callbacks.
Public method SetValue When overridden in a derived class, sets a context item to the specified value.
Public method Subscribe(Type, SubscribeContextCallback) When overridden in a derived class, adds a callback that is invoked when a context item of the specified item type changes.
Public method Subscribe<TContextItemType>(SubscribeContextCallback<TContextItemType>) Adds a callback that is invoked when a context item of the specified item type changes.
Public method ToString Returns a string that represents the current object. (Inherited from Object.)
Public method Unsubscribe(Type, SubscribeContextCallback) When overridden in a derived class, removes a subscription.
Public method Unsubscribe<TContextItemType>(SubscribeContextCallback<TContextItemType>) Removes a subscription.

Top

Explicit Interface Implementations

  Name Description
Explicit interface implemetationPrivate method IEnumerable.GetEnumerator For a description of this member, see IEnumerable.GetEnumerator.

Top

Remarks

The ContextItemManager class maintains a set of context items. A context item represents a transient piece of state in a designer.

Create a ContextItemManager by calling the CreateContextItemManager method on EditingContext.

Use the Subscribe method to subscribe to change notifications on context items.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Microsoft.Windows.Design Namespace

ContextItem

SubscribeContextCallback<TContextItemType>

ServiceManager

FeatureManager

Other Resources

Editing Context Architecture

Understanding WPF Designer Extensibility