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

    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.

    #2
    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.
    Alan P.NinjaTrader Customer Service

    Comment


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

      Comment


        #4
        Hello aslane,

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

        Thank you for your patience.
        Alan P.NinjaTrader Customer Service

        Comment


          #5
          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
          Alan P.NinjaTrader Customer Service

          Comment


            #6
            Perfect, thank you.

            Comment


              #7
              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]
               }

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by swestendorf, Today, 11:14 AM
              2 responses
              5 views
              0 likes
              Last Post NinjaTrader_Kimberly  
              Started by xiinteractive, 04-09-2024, 08:08 AM
              4 responses
              13 views
              0 likes
              Last Post xiinteractive  
              Started by Mupulen, Today, 11:26 AM
              0 responses
              2 views
              0 likes
              Last Post Mupulen
              by Mupulen
               
              Started by Sparkyboy, Today, 10:57 AM
              1 response
              5 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Started by TheMarlin801, 10-13-2020, 01:40 AM
              21 responses
              3,917 views
              0 likes
              Last Post Bidder
              by Bidder
               
              Working...
              X