---
id: "T:cAlgo.API.WindowDeactivatedEventArgs"
kind: "class"
namespace: "cAlgo.API"
url: "https://help.ctrader.com/ctrader-algo/references/EventArgs/WindowDeactivatedEventArgs/"
---

> Documentation index for agents: https://help.ctrader.com/ctrader-algo/llms.txt · machine index: https://help.ctrader.com/ctrader-algo/api.json

# WindowDeactivatedEventArgs (class)

Provides data for WindowDeactivated event handlers

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Never raised in the CLI: the events that pass it never fire there (Window.Deactivated).
- Cloud: Never raised in the cloud: the events that pass it never fire there (Window.Deactivated).

## Definition

```csharp
public class WindowDeactivatedEventArgs
```

## Examples

C#:

```csharp
protected override void OnStart()
{
    var window = new Window { Title = "Trade Panel", Width = 300, Height = 200, Child = new TextBlock { Text = "Hello" } };
    window.Deactivated += OnWindowDeactivated;
    window.Show();
}

private void OnWindowDeactivated(WindowDeactivatedEventArgs args)
{
    Print("Window {0} deactivated", args.Window.Title);
}
```

Python:

```python
def on_start(self):
    text_block = TextBlock()
    text_block.Text = "Hello"
    window = Window()
    window.Title = "Trade Panel"
    window.Width = 300
    window.Height = 200
    window.Child = text_block
    window.Deactivated += self.on_window_deactivated
    window.Show()

def on_window_deactivated(self, args):
    api.Print(f"Window {args.Window.Title} deactivated")
```

## Properties

- `public Window Window {get;}` — The window that got deactivated [details](https://help.ctrader.com/ctrader-algo/references/EventArgs/WindowDeactivatedEventArgs/Window/index.md)

