I added two TextBoxes to charttrader. I now want to access them from a darawing tool. I'm making an error in the code to access them. Here is what I've tried.
I don't know what to instantiate MyControl with in the first selection:
foreach (DependencyObject item in MyControl)
Print(string.Format("AutomationId: {0} | item: {1}", System.Windows.Automation.AutomationProperties.GetAutomationId(item), item));
if (System.Windows.Automation.AutomationProperties.GetAutomationId(item) == "MyObjectsAutomationId")
Print("found my object");
}
chartTraderGrid = (chartWindow.FindFirst("ChartWindowChartTraderControl") as Gui.Chart.ChartTrader).Content as System.Windows.Controls.Grid;
TextBox tb = chartTraderGrid.FindFirst("textBox00") as TextBox;
TextBox textBox01 = Window.GetWindow(ChartControl.Parent).FindFirst("textBox00") as TextBox;
Thanks in advance.

Comment