DesignSurface Class

Definition

Presents a user interface for designing components.

public ref class DesignSurface : IDisposable, IServiceProvider
public class DesignSurface : IDisposable, IServiceProvider
[System.Security.SecurityCritical]
public class DesignSurface : IDisposable, IServiceProvider
type DesignSurface = class
    interface IDisposable
    interface IServiceProvider
[<System.Security.SecurityCritical>]
type DesignSurface = class
    interface IDisposable
    interface IServiceProvider
Public Class DesignSurface
Implements IDisposable, IServiceProvider
Inheritance
DesignSurface
Attributes
Implements

Remarks

The DesignSurface class implements what the user perceives as a designer. DesignSurface is the user interface the user manipulates to change design-time features. DesignSurface provides a completely self-contained design surface.

The DesignSurface class may be used as a stand-alone designer, or it may be coupled with the DesignSurfaceManager class to provide a common implementation for an application that hosts multiple DesignSurface objects.

The DesignSurface class can be used by itself, or the user can derive a new class from it and augment the behavior.

The DesignSurface class provides several design-time services automatically. The DesignSurface class adds all of its services in its constructor. Most of these services can be overridden by replacing them in the protected ServiceContainer property. To replace a service, override the constructor, call base, and make any changes through the protected ServiceContainer property. All services that are added to the service container and that implement IDisposable are disposed when the design surface is disposed. The default set of replaceable services that the DesignSurface class provides is shown in the following table.

Service Description
IExtenderProviderService Enables objects that are not part of the container's components collection to provide their own extender providers.
IExtenderListService Used by TypeDescriptor to get a list of extender providers. With this service, extender providers can live outside of the container.
ITypeDescriptorFilterService Provides designer metadata hooks. This is the primary interface for metadata filtering.
ISelectionService Provides a way to select components in the designer.
IReferenceService Provides a way to get a name for objects, even when those objects are not sited.
DesignSurface Offers the design surface itself as a service.
DesignerOptionService Provides a base class for getting and setting option values for a designer.

The following table shows the non-replaceable services provided by default.

Service Description