Skip to main content

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.v23.2.dll

NuGet Package: DevExpress.Wpf.Core

Declaration

public bool UnregisterOnUnloaded { get; set; }

Property Value

Type Description
Boolean

true to unregister the service when the associated View is unloaded; otherwise, false.

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.

See Also