Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Window/Tab Ids

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Bidder
    replied
    Get tab or window id

    In an indicator call from State.configure. Will return either the window or tab guid.

    Code:
    public enum IdTw {Tab,Window}
    
    protected string GetChartId(IdTw IdType)
    {[INDENT]string Identifier = "";
    Chart chartWindow = Window.GetWindow(ChartControl.Parent) as Chart;
    chartWindow.Dispatcher.Invoke((Action)(() => {[/INDENT][INDENT=2]if (IdType == IdTw.Tab)
    {[/INDENT][INDENT=3]TabItem t = chartWindow.MainTabControl.SelectedItem as TabItem;
    ChartTab TabMe = t.Content as ChartTab;
    Identifier = TabMe.PersistenceId;[/INDENT][INDENT=2]}
    if (IdType == IdTw.Window)
    {[/INDENT][INDENT=3]IWorkspacePersistence winPer = chartWindow as IWorkspacePersistence;
    Identifier = winPer.WorkspaceOptions.PersistenceId;[/INDENT][INDENT=2]}[/INDENT][INDENT]}));
    
    return Identifier;[/INDENT]
     }

    Leave a comment:


  • aslane
    replied
    Perfect, thank you.

    Leave a comment:


  • NinjaTrader_AlanP
    replied
    Hello aslane,

    The attached unsupported sample would print to the output window a unique ID for each window.

    Please let us know if you need further assistance.
    Attached Files

    Leave a comment:


  • NinjaTrader_AlanP
    replied
    Hello aslane,

    I'm waiting to hear back on this and will follow up when I have more information.

    Thank you for your patience.

    Leave a comment:


  • aslane
    replied
    So there is no way to access the persistence id of a window? Isn't it stored as an attribute somewhere?

    Leave a comment:


  • NinjaTrader_AlanP
    replied
    Hello aslane,

    Thank you for your note.

    This would not be supported however I will submit a feature request on your behalf.

    Please let us know if you need further assistance.

    Leave a comment:


  • aslane
    started a topic Window/Tab Ids

    Window/Tab Ids

    I am trying to find and use a unique id for each window and tab. I did not see anything in the doc, and only found PersistId, but that is only an int and marked depreciated.

    I did find this old thread from the Beta: https://ninjatrader.com/support/foru...ad.php?t=81737 which talks about tracking id NTEIGHT-9319

    Can you please point me to an example that shows how to get the unique id for each window and each tab within the window?

    Thanks.


    Edit: I did find the PersistenceId on the ChartTab, but still looking for similar on Window.
    Last edited by aslane; 07-07-2018, 01:05 PM.

Latest Posts

Collapse

Topics Statistics Last Post
Started by Trader146, Today, 11:41 AM
0 responses
2 views
0 likes
Last Post Trader146  
Started by jpapa, 04-23-2024, 07:22 AM
2 responses
16 views
0 likes
Last Post rene69851  
Started by funk10101, Today, 11:35 AM
0 responses
1 view
0 likes
Last Post funk10101  
Started by samish18, Today, 11:26 AM
0 responses
1 view
0 likes
Last Post samish18  
Started by Trader146, 03-29-2024, 01:22 PM
2 responses
14 views
0 likes
Last Post Trader146  
Working...
X