# DeviceLifecycle

Namespace: **Wisej.Hybrid**

Assembly: **Wisej.Hybrid** (3.5.0.0)

Provides events related to the device lifecycle.

{% tabs %}
{% tab title="C#" %}

```csharp
public class DeviceLifecycle
```

{% endtab %}

{% tab title="VB.NET" %}

```visual-basic
Public Class DeviceLifecycle
```

{% endtab %}
{% endtabs %}

See: <https://learn.microsoft.com/en-us/dotnet/maui/fundamentals/app-lifecycle> Access this class through the [Info](/hybrid/start/api/general/wisej.hybrid.device.md#info) singleton.

## Constructors

### ![](/files/CCV9PPenlC1YZvNh1I6R)DeviceLifecycle()

Creates a new instance of [DeviceLifecycle](/hybrid/start/api/system/wisej.hybrid.devicelifecycle.md).

## Events

### ![](/files/CCV9PPenlC1YZvNh1I6R)Activated

[EventHandler](https://docs.microsoft.com/dotnet/api/system.eventhandler) Raised when the window has been activated, and is, or will become, the focused window.

### ![](/files/CCV9PPenlC1YZvNh1I6R)Backgrounding

[EventHandler](https://docs.microsoft.com/dotnet/api/system.eventhandler) Raised when the hybrid app is entering the background.

### ![](/files/CCV9PPenlC1YZvNh1I6R)Deactivated

[EventHandler](https://docs.microsoft.com/dotnet/api/system.eventhandler) Raised when the window is no longer the focused window. However, the window might still be visible.

### ![](/files/CCV9PPenlC1YZvNh1I6R)Destroying

[EventHandler](https://docs.microsoft.com/dotnet/api/system.eventhandler) Raised when the native window is being destroyed and deallocated. The same cross-platform window might be used against a new native window when the app is reopened.

### ![](/files/CCV9PPenlC1YZvNh1I6R)Resumed

[EventHandler](https://docs.microsoft.com/dotnet/api/system.eventhandler) Raised when an app resumes after being stopped. This event won't be raised the first time your app launches, and can only be raised if the Stopped event has previously been raised.

### ![](/files/CCV9PPenlC1YZvNh1I6R)Stopped

[EventHandler](https://docs.microsoft.com/dotnet/api/system.eventhandler) Raised when the window is no longer visible. There's no guarantee that an app will resume from this state, because it may be terminated by the operating system.


---

# 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.wisej.com/hybrid/start/api/system/wisej.hybrid.devicelifecycle.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.
