wpf-devexpress-dot-xpf-dot-richedit-dot-richeditcontrol-dot-addservice-x28-system-dot-type-system-dot-object-x29.md
Adds the specified service to the service container.
Namespace : DevExpress.Xpf.RichEdit
Assembly : DevExpress.Xpf.RichEdit.v25.2.dll
NuGet Package : DevExpress.Wpf.RichEdit
public void AddService(
Type serviceType,
object serviceInstance
)
Public Sub AddService(
serviceType As Type,
serviceInstance As Object
)
| Name | Type | Description |
|---|---|---|
| serviceType | Type |
The type of service to add.
| | serviceInstance | Object |
An instance of the service type to add. This object must implement or inherit from the type indicated by the serviceType parameter.
|
The RichEditControl implements IServiceProvider and IServiceContainer interfaces. In addition to providing services, it also provides a mechanism for adding and removing services. To obtain a service, call the RichEditControl.GetService method.
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the AddService(Type, Object) method.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
wpf-richedit-use-docvariable-fields/CS/MainWindow.xaml.cs#L42
richEditControl1.RemoveService(typeof(IProgressIndicationService));
richEditControl1.AddService(typeof(IProgressIndicationService),
new MyProgressIndicatorService(richEditControl1, this.progressBarControl1));
See Also