Skip to content

WindowAwareViewModel class

Base class for view models that are shown in a window of their own by IWindowService or IDialogService. It tracks the window the view model is attached to, closes it on request, and creates the view declared by ViewLocatorAttribute.

Namespace: Eremex.AvaloniaUI.Controls.ApplicationServices
Assembly: Eremex.Avalonia.Controls.ApplicationServices.dll
NuGet Package: Eremex.Avalonia.Controls.ApplicationServices

Declaration

public class WindowAwareViewModel : ViewModelBase, IWindowAwareViewModel

Public Members

name description
WindowAwareViewModel() Initializes a new instance of the WindowAwareViewModel class with an empty window caption.
WindowAwareViewModel(…) Initializes a new instance of the WindowAwareViewModel class with the given window caption.
Content { get; set; }
IsVisible { get; }
Title { get; set; }
WindowStyleClasses { get; set; }

Remarks

Derived classes override AttachCore and DetachCore to react to the window opening and closing, and CanCloseWindow to veto a close.

See Also

Used in articles