or
[TestMethod]public void TestMethod(){ // find app window var cond = new PropertyCondition(AutomationElement.NameProperty, "MainWindow"); AutomationElement foundWindow = AutomationElement.RootElement.FindFirst(TreeScope.Children, cond); // find tab control cond = new PropertyCondition(AutomationElement.ControlTypeProperty, System.Windows.Automation.ControlType.Tab); AutomationElement foundTab = foundWindow.FindFirst(TreeScope.Subtree, cond); var tabCtl = (WpfTabList)UITestControlFactory.FromNativeElement(foundTab, "UIA"); foreach (var tab in tabCtl.Tabs) { var elements = ""; Mouse.Click(tab); // do something to controls, // for example collect their names foreach (var el in Walk(tab.NativeElement as AutomationElement)) { elements += string.Format("Name: '{0}', Type: '{1}'\n", el.Current.Name, el.Current.ControlType.ProgrammaticName); } MessageBox.Show(elements); }}// Recursively walk an automation treeprivate List<AutomationElement> Walk(AutomationElement current){ var res = new List<AutomationElement>(); if (current != null) { res.Add(current); res.AddRange(Walk(TreeWalker.RawViewWalker.GetFirstChild(current))); res.AddRange(Walk(TreeWalker.RawViewWalker.GetNextSibling(current))); } return res;}<tel:MapLine StrokeThickness="5" Stroke="Red" Point1="{Binding MyViewModel.Point1}" Point2="{Binding MyViewModel.Point2}" ToolTip="{Binding MyViewModel.ItemName}" /><tel:MapLine StrokeThickness="5" Point1="{Binding MyViewModel.Point1}" Point2="{Binding MyViewModel.Point2}"> <tel:MapLine.Stroke> <SolidColorBrush Color="Red" /> </tel:MapLine.Stroke> <tel:MapLine.ToolTip> <TextBlock Text="{Binding MyViewModel.ItemName}" /> </tel:MapLine.ToolTip></tel:MapLine><tel:MapRectangle Location="{Binding Location}" />public class FooViewModel : ViewModelBase { private ObservableCollection<Foo> _fooCollection; private Foo _selectedFoo; private ICommand _addCommand; public ObservableCollection<Foo> FooCollection { get { return _fooCollection; } set { _fooCollection = value; OnPropertyChanged("FooCollection"); } } public Foo SelectedFoo { get { return _selectedFoo; } set { _selectedFoo = value; OnPropertyChanged("SelectedFoo"); } } public ICommand AddCommand { get { return _addCommand ?? (_addCommand = new RelayCommand(i=>this.AddCommandMethod())); } } private void AddCommandMethod() { //Add item to collection //Add item to SelectedFoo }<telerik:RadCartesianChart> <telerik:RadCartesianChart.HorizontalAxis> <telerik:DateTimeCategoricalAxis LabelFitMode="None" LabelFormat="H" DateTimeComponent="Hour" /> </telerik:RadCartesianChart.HorizontalAxis> <telerik:RadCartesianChart.VerticalAxis> <telerik:LinearAxis /> </telerik:RadCartesianChart.VerticalAxis> <telerik:LineSeries ItemsSource="{Binding}" CategoryBinding="XValue" ValueBinding="YValue"/> </telerik:RadCartesianChart>public class ChartData { public DateTime XValue { get; set; } public Double YValue { get; set; } }List<ChartData> datas = new List<ChartData>(); for (int i = 0; i < 23; i++) { datas.Add(new ChartData { XValue = DateTime.Today.AddHours(i), YValue = i }); } DataContext = datas;