# WindowService.Show&lt;T&gt; method (1 of 2)

```csharp
public void Show<T>(T viewModel, string? caption = null)
    where T : IWindowAwareViewModel
```

## See Also

* class [WindowService](../WindowService.md)
* namespace [Eremex.AvaloniaUI.Controls.ApplicationServices](../index.md)

---

# WindowService.Show&lt;T&gt; method (2 of 2)

Shows a non-modal window. When no owner is given, the active application window is used.

```csharp
public void Show<T>(T viewModel, string? caption, Window? owner)
    where T : IWindowAwareViewModel
```

| parameter | description |
| --- | --- |
| T | The type of the view model that drives the window. |
| viewModel | The view model to display. It stays attached to the window until the window closes. |
| caption | The window caption. When `null`, the caption is taken from Title. |
| owner | The window that owns the new window. When `null`, the active application window is used; if there is none, the window is shown without an owner. |

## Exceptions

| exception | condition |
| --- | --- |
| ArgumentNullException | *viewModel* is `null`. |

## See Also

* class [WindowService](../WindowService.md)
* namespace [Eremex.AvaloniaUI.Controls.ApplicationServices](../index.md)

<!-- DO NOT EDIT: generated by xmldocmd for Eremex.Avalonia.Controls.ApplicationServices.dll -->
