---
id: "T:cAlgo.API.AspBlock"
kind: "interface"
namespace: "cAlgo.API"
url: "https://help.ctrader.com/ctrader-algo/references/Plugin/Asp/AspBlock/"
---

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

# AspBlock (interface)

Represents an active symbol panel block.

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

- CLI: Available to plugins only, and plugins cannot run in the CLI.
- Cloud: Available to plugins only, and plugins cannot run in the cloud.

## Definition

```csharp
public interface AspBlock
```

## Examples

C#:

```csharp
using cAlgo.API;

namespace cAlgo.Plugins
{
    public partial class Test : Plugin
    {
        protected override void OnStart()
        {
            var aspSymbolTabBlock = Asp.SymbolTab.AddBlock("Test Block");

            var panel = new StackPanel {Orientation = Orientation.Vertical};

            var webView = new WebView() {Height = 250};

            webView.Loaded += args => webView.NavigateAsync("https://ctrader.com/");

            panel.AddChild(webView);

            var removeBlockButton = new Button {Text = "Remove Block"};

            removeBlockButton.Click += args => Asp.SymbolTab.RemoveBlock(aspSymbolTabBlock);

            panel.AddChild(removeBlockButton);

            aspSymbolTabBlock.Child = panel;

            aspSymbolTabBlock.Height = 300;

            aspSymbolTabBlock.DetachedWindow.Width = 400;
            aspSymbolTabBlock.DetachedWindow.Height = 350;

            aspSymbolTabBlock.Detached += args => Print("Block detached");
            aspSymbolTabBlock.Attached += args => Print("Block attached");
            aspSymbolTabBlock.Updated += args => Print("Block updated");
        }
    }
}
```

Python:

```python
import clr
clr.AddReference("cAlgo.API")

from cAlgo.API import *

class Test():
    def on_start(self):
        aspSymbolTabBlock = api.Asp.SymbolTab.AddBlock("Test Block")

        panel = StackPanel()
        panel.Orientation = Orientation.Vertical

        webView = WebView()
        webView.Height = 250
        webView.Loaded += lambda _: webView.NavigateAsync("https://ctrader.com/")

        panel.AddChild(webView)

        removeBlockButton = Button()
        removeBlockButton.Text = "Remove Block"
        removeBlockButton.Click += lambda _: api.Asp.SymbolTab.RemoveBlock(aspSymbolTabBlock)

        panel.AddChild(removeBlockButton)

        aspSymbolTabBlock.Child = panel
        aspSymbolTabBlock.Height = 300
        aspSymbolTabBlock.DetachedWindow.Width = 400
        aspSymbolTabBlock.DetachedWindow.Height = 350

        aspSymbolTabBlock.Detached += lambda _: print("Block detached")
        aspSymbolTabBlock.Attached += lambda _: print("Block attached")
        aspSymbolTabBlock.Updated += lambda _: print("Block updated")
```

config.json:

```json
{
  "AccessRights": "None"
}
```

## Properties

- `ControlBase Child {get; set;}` — Get / set content of current block. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Asp/AspBlock/Child/index.md)
- `DetachedWindow DetachedWindow {get;}` — Returns detached window properties. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Asp/AspBlock/DetachedWindow/index.md)
- `double Height {get; set;}` — Get / set height of current block (default is 200). [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Asp/AspBlock/Height/index.md)
- `string Id {get;}` — Returns unique ID of the current block. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Asp/AspBlock/Id/index.md)
- `int Index {get; set;}` — Get index of current block. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Asp/AspBlock/Index/index.md)
- `bool IsAttached {get; set;}` — Get / set block attached / detached state. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Asp/AspBlock/IsAttached/index.md)
- `bool IsDetachable {get; set;}` — Get / set block detachability, if True user can attach or detach the block. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Asp/AspBlock/IsDetachable/index.md)
- `bool IsExpanded {get; set;}` — Get expanded state of current block. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Asp/AspBlock/IsExpanded/index.md)
- `string Title {get;}` — Returns title of the current block. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Asp/AspBlock/Title/index.md)

## Events

- `event Action<AspBlockAttachedEventArgs> Attached;` — Occurs when block attached. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Asp/AspBlock/Attached/index.md)
- `event Action<AspBlockDetachedEventArgs> Detached;` — Occurs when block is detached. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Asp/AspBlock/Detached/index.md)
- `event Action<AspBlockUpdatedEventArgs> Updated;` — Occurs when block is updated. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Asp/AspBlock/Updated/index.md)

