Skip to content

Implementing Instancing

Gary edited this page Aug 27, 2014 · 1 revision

Table of Contents

Implement the IInstancingContext interface in a class that provides services for a context in the application. This usually means implementing other interfaces as well. As previously noted, the ISelectionContext interface must be implemented, so items can be selected in that context.

For example, the ATF Simple DOM Editor Sample implements a context for its Resources window's ListView with its EventContext class. This class implements IInstancingContext and is derived from EditingContext, which implements ISelectionContext:

public class EventContext : EditingContext,
    IListView,
    IItemView,
    IObservableContext,
    IInstancingContext,
    IEnumerableContext

Implementing IInstancingContext

The ATF Simple DOM Editor Sample implements IInstancingContext in two context classes: EventContext as noted previously, and EventSequenceContext for the ListView of its main window. To see how all the IInstancingContext methods are implemented in EventContext, see IInstancingContext Interface. This also shows how the StandardEditCommands component interacts with these methods.

Implementing Drag and Drop

You can also use IInstancingContext with drag and drop editing. To learn how the ATF Simple DOM Editor Sample uses drag and drop for its editing with IInstancingContext, see the previous topic, Drag and Drop and Instancing.

Topics in this section

Clone this wiki locally