# Default view behaviors

We have seen how Radical Presentation [resolves views instances](/release-1/presentation/iview-resolver.md) at runtime and we have told that during the resolution process we inject/attach to the resolved view some behaviors using a convention.

The convention attaches the following behaviors to each resolved view:

* to every view (every DependencyObject) attaches the “**DependencyObjectCloseHandlerBehavior**” whose role is to allow the view model to send a close request message to its own view without the need to handle a reference to the view;
* if the **view is a window** attaches the “**WindowLifecycleNotificationsBehavior**” used to notify to the view model the lifecycle state changes of the view (loaded, shown, activated, closing and closed);
* “else if” the **view is a FrameworkElement** attaches the “**FrameworkElementLifecycleNotificationsBehavior**” whose role is notify to the view model when the view is loaded;

The easiest way to handle view lifecycle state changes in the `ViewModel` is to setup a [callback expectation](/release-1/presentation/iview-resolver/view-life-cycle-events/callback-expectations.md).

## Automatic broker unsubscribe

The `WindowLifecycleNotificationsBehavior` whenever the `view` is closed invokes `ViewReleaseHandler` convention that is responsible to determine if the `ViewModel` associated with the closed `View` should be unsubscribed from all the message broker subscriptions, if any, created.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.radicalframework.com/release-1/presentation/iview-resolver/default-view-behaviors.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
