Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Any way to access the unique ID (identifier) of chart window?

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

    Any way to access the unique ID (identifier) of chart window?

    In NT7 i remember i used a property like ChartHandleId or whatever, so, I saved each chart's identified in c# dictionary.
    What is the alternative in NT8 ? lets say, I want to get the unqinue identifiers for each opened charts and then save some values along with those identifiers in dictionaries.

    I tried this:
    ChartPanel.GetHashCode().ToString()

    but it still give different identifiers from two indicators attached (on different panels) on same chart

    #2
    Found them myself. These seems to be some kind of identifiers, unique for windows (with multiple indicators/sub-charts in them):


    Code:
    ChartControl.OwnerChart.Form.Handle); //same as: ChartControl.OwnerChart.Form.Handle.GetHashCode();
    ChartControl.OwnerChart.GetHashCode()
    ChartControl.Parent.GetHashCode()
    these were not usable for me:

    Code:
    Owner --- null
    ChartPanel.Parent -- ChartControl object
    ChartControl.OwnerChart.Name --- calling thread cant access this
    ChartControl.OwnerChart.TabIndex --- calling thread cant access this
    ChartControl.OwnerChart.Tag --- calling thread cant access this
    ChartControl.OwnerChart.Uid ---calling thread cant access this
    ChartControl.OwnerChart.Parent --> NULL
    ChartControl.OwnerChart.Owner --calling thread cant access this
    Last edited by ttodua; 08-26-2019, 01:19 PM.

    Comment


      #3
      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)
      {string Identifier = "";
      Chart chartWindow = Window.GetWindow(ChartControl.Parent) as Chart;
      chartWindow.Dispatcher.Invoke((Action)(() => {if (IdType == IdTw.Tab)
      {TabItem t = chartWindow.MainTabControl.SelectedItem as TabItem;
      ChartTab TabMe = t.Content as ChartTab;
      Identifier = TabMe.PersistenceId;}
      if (IdType == IdTw.Window)
      {IWorkspacePersistence winPer = chartWindow as IWorkspacePersistence;
      Identifier = winPer.WorkspaceOptions.PersistenceId;}}));
      
      return Identifier;
        }
      Last edited by Bidder; 10-30-2024, 04:43 PM.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      571 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      330 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      101 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      548 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      549 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X