private PerfDataGrid NextGrid(PerfDataGrid grid)
 {
     if (grid == CallersGrid)
     {
         return(FocusGrid);
     }
     if (grid == FocusGrid)
     {
         return(CalleesGrid);
     }
     Debug.Assert(grid == CalleesGrid);
     return(null);
 }
        public CallTreeView(PerfDataGrid perfGrid, DataTemplate template)
        {
            m_flattenedTree             = new ObservableCollectionEx <CallTreeViewNode>();
            m_perfGrid                  = perfGrid;
            m_perfGrid.Grid.ItemsSource = m_flattenedTree;
            DisplayPrimaryOnly          = true; // we assume we are a non-memory window, which has no secondary.

            // Make the name column have tree control behavior
            var nameColumn = perfGrid.Grid.Columns[0] as DataGridTemplateColumn;

            Debug.Assert(nameColumn != null);
            nameColumn.CellTemplate = template;

            // Put the indentation in when we cut and paste
            nameColumn.ClipboardContentBinding = new Binding("IndentedName");
        }