Back to Devexpress

RichEditControl.RemoveService(Type) Method

wpf-devexpress-dot-xpf-dot-richedit-dot-richeditcontrol-dot-removeservice-x28-system-dot-type-x29.md

latest4.1 KB
Original Source

RichEditControl.RemoveService(Type) Method

Removes the service of specified type from the service container.

Namespace : DevExpress.Xpf.RichEdit

Assembly : DevExpress.Xpf.RichEdit.v25.2.dll

NuGet Package : DevExpress.Wpf.RichEdit

Declaration

csharp
public void RemoveService(
    Type serviceType
)
vb
Public Sub RemoveService(
    serviceType As Type
)

Parameters

NameTypeDescription
serviceTypeType

The type of service to remove.

|

Remarks

The RichEdit Control 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 snippets (auto-collected from DevExpress Examples) contain references to the RemoveService(Type) 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#L41

csharp
private void richEditControl1_MailMergeStarted(object sender, MailMergeStartedEventArgs e) {
    richEditControl1.RemoveService(typeof(IProgressIndicationService));
    richEditControl1.AddService(typeof(IProgressIndicationService),

dxrichedit-for-wpf-how-to-implement-progress-indicator/CS/MainWindow.xaml.cs#L40

csharp
private void richEditControl1_MailMergeFinished(object sender, MailMergeFinishedEventArgs e) {
    richEditControl1.RemoveService(typeof(IProgressIndicationService));
}

wpf-richedit-use-docvariable-fields/VB/MainWindow.xaml.vb#L42

vb
Private Sub richEditControl1_MailMergeStarted(ByVal sender As Object, ByVal e As MailMergeStartedEventArgs)
    Me.richEditControl1.RemoveService(GetType(IProgressIndicationService))
    Me.richEditControl1.AddService(GetType(IProgressIndicationService), New MyProgressIndicatorService(Me.richEditControl1, Me.progressBarControl1))

dxrichedit-for-wpf-how-to-implement-progress-indicator/VB/MainWindow.xaml.vb#L41

vb
Private Sub richEditControl1_MailMergeFinished(ByVal sender As Object, ByVal e As MailMergeFinishedEventArgs)
    Me.richEditControl1.RemoveService(GetType(IProgressIndicationService))
End Sub

See Also

GetService(Type)

RichEditControl Class

RichEditControl Members

DevExpress.Xpf.RichEdit Namespace