Skip to content

AspBlock

Summary

Represents an active symbol panel block.

Signature

1
public abstract interface AspBlock

Namespace

cAlgo.API

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
 using cAlgo.API;
 namespace cAlgo.Plugins
 {
     [Plugin(AccessRights = AccessRights.None)]
     public 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");
         }
     }        
 }
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 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")

See Also

Properties

Id

Summary

Returns unique ID of the current block.

Signature

1
public abstract string Id {get;}

Return Value

string

Title

Summary

Returns title of the current block.

Signature

1
public abstract string Title {get;}

Return Value

string

Child

Summary

Get / set content of current block.

Signature

1
public abstract ControlBase Child {get; set;}

Return Value

ControlBase

Height

Summary

Get / set height of current block (default is 200).

Signature

1
public abstract double Height {get; set;}

Return Value

double

Index

Summary

Get index of current block.

Signature

1
public abstract int Index {get; set;}

Return Value

int

IsExpanded

Summary

Get expanded state of current block.

Signature

1
public abstract bool IsExpanded {get; set;}

Return Value

bool

IsAttached

Summary

Get / set block attached/ detached state.

Signature

1
public abstract bool IsAttached {get; set;}

Return Value

bool

IsDetachable

Summary

Get / set block detachability, if True user can attach or detach the block.

Signature

1
public abstract bool IsDetachable {get; set;}

Return Value

bool

DetachedWindow

Summary

Returns detached window properties.

Signature

1
public abstract DetachedWindow DetachedWindow {get;}

Return Value

DetachedWindow

Events

Attached

Summary

Occurs when block attached.

Signature

1
public abstract event Action<AspBlockAttachedEventArgs> Attached;

Detached

Summary

Occurs when block is detached.

Signature

1
public abstract event Action<AspBlockDetachedEventArgs> Detached;

Updated

Summary

Occurs when block is updated.

Signature

1
public abstract event Action<AspBlockUpdatedEventArgs> Updated;