ServiceBase.UnregisterOnUnloaded Property
Gets or sets whether to unregister the service when the associated View is unloaded. This is a dependency property.
Namespace: DevExpress.Mvvm.UI
Assembly: DevExpress.Xpf.Core.v25.2.dll
NuGet Package: DevExpress.Wpf.Core
Declaration
Property Value
| Type | Description |
|---|---|
| Boolean |
|
Remarks
If you pass a View Model to a service through service methods (for example, the viewModel parameter in the DialogService.ShowDialog method) and reuse the View Model between method calls, the service stays in memory with the associated View. Set the UnregisterOnUnloaded property to true to change this behavior and prevent memory leaks.
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the UnregisterOnUnloaded property.
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.