# 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.

```csharp
public class WindowAwareViewModel : ViewModelBase, IWindowAwareViewModel
```

## Public Members

| name | description |
| --- | --- |
| [WindowAwareViewModel](WindowAwareViewModel/WindowAwareViewModel.md)() | Initializes a new instance of the [`WindowAwareViewModel`](./WindowAwareViewModel.md) class with an empty window caption. |
| [WindowAwareViewModel](WindowAwareViewModel/WindowAwareViewModel.md)(…) | Initializes a new instance of the [`WindowAwareViewModel`](./WindowAwareViewModel.md) class with the given window caption. |
| [Content](WindowAwareViewModel/Content.md) { get; set; } |  |
| [IsVisible](WindowAwareViewModel/IsVisible.md) { get; } |  |
| [Title](WindowAwareViewModel/Title.md) { get; set; } |  |
| [WindowStyleClasses](WindowAwareViewModel/WindowStyleClasses.md) { 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

* namespace [Eremex.AvaloniaUI.Controls.ApplicationServices](./index.md)

<!-- DO NOT EDIT: generated by xmldocmd for Eremex.Avalonia.Controls.ApplicationServices.dll -->
