# Minimizing and Maximizing

The Window title bar provides commands to minimize it, maximize it to the viewport, or restore its default size. The [`state`](https://www.telerik.com/kendo-angular-ui/components/dialogs/api/windowcomponent#state) property reflects the current view and accepts `default`, `minimized`, or `maximized`.

## Persisting the State

To set the initial state and keep it in sync with the title bar actions, control the Window by:

1. Setting the [`state`](https://www.telerik.com/kendo-angular-ui/components/dialogs/api/windowcomponent#state) property.
2. Updating the value in the [`stateChange`](https://www.telerik.com/kendo-angular-ui/components/dialogs/api/windowcomponent#statechange) event handler, or by using two-way binding.

If you close and reopen the Window while the parent retains that value, the Window reopens in the last state.

The following example keeps the state in the parent component and changes it from the title bar and from external buttons.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/dialogs/window/minimize-maximize/persist-state/source.txt)

## Keeping the Content

By default, the Window removes its content element from the DOM when minimized. Set [`keepContent`](https://www.telerik.com/kendo-angular-ui/components/dialogs/api/windowcomponent#keepcontent) to `true` to hide the content instead and keep it in the DOM. Windows that the [`WindowService`](https://www.telerik.com/kendo-angular-ui/components/dialogs/api/windowservice) opens with the `minimized` state also keep their content in the DOM, because the service sets `keepContent` to `true`.

The following example keeps the Window content in the DOM while minimized.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/dialogs/window/minimize-maximize/keep-content/source.txt)

## Suggested Links

* [API Reference of the Window](https://www.telerik.com/kendo-angular-ui/components/dialogs/api/windowcomponent)
