IWpfTextViewMarginProvider Interface
Visual Studio 2015
Creates an IWpfTextViewMargin for a given IWpfTextViewHost.
Assembly: Microsoft.VisualStudio.Text.UI.Wpf (in Microsoft.VisualStudio.Text.UI.Wpf.dll)
| Name | Description | |
|---|---|---|
![]() | CreateMargin(IWpfTextViewHost, IWpfTextViewMargin) | Creates an IWpfTextViewMargin for the given IWpfTextViewHost. |
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)]
Show:
