IWpfTextViewMarginProvider Interface

Creates an IWpfTextViewMargin for a given IWpfTextViewHost.

Namespace:  Microsoft.VisualStudio.Text.Editor
Assembly:  Microsoft.VisualStudio.Text.UI.Wpf (in Microsoft.VisualStudio.Text.UI.Wpf.dll)

public interface IWpfTextViewMarginProvider

The IWpfTextViewMarginProvider type exposes the following members.

  NameDescription
Public methodCreateMarginCreates an IWpfTextViewMargin for the given IWpfTextViewHost.
Top

This is a MEF component part, and should be exported with the following attribute:

[Export(typeof(IWpfTextViewMarginProvider))] 

Exporters must supply a MarginContainerAttribute (with one of the PredefinedMarginNames as the container), ContentTypeAttribute, OrderAttribute (with respect to one of the PredefinedMarginNames), TextViewRoleAttribute, and NameAttribute.

For more information about margins, see the "Margins" section of Inside the Editor. For information about extending margins and scrollbars, see the "Extending Margins and Scrollbars" section in Editor Extension Points.

The following example shows how to set up the attributes for this export:

Name("TestMarginProvider")]
[Export(typeof(IWpfTextViewMarginProvider))]
[Order(Before = PredefinedMarginNames.VerticalScrollBarContainer)]
[MarginContainer(PredefinedMarginNames.RightControl)]
[ContentType("text")]
[TextViewRole(PredefinedTextViewRoles.PrimaryDocument)]
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft