private void xamDataTreeCases_Loaded(object sender, RoutedEventArgs e) { Infragistics.Controls.Menus.XamDataTree tree = (Infragistics.Controls.Menus.XamDataTree)sender; // having to set this again to make the collection show up tree.ItemsSource = viewModel.CaseCollection; foreach (Infragistics.Controls.Menus.XamDataTreeNode tn in tree.Nodes) { if (tn.Data is CaseList) { foreach (Infragistics.Controls.Menus.XamDataTreeNode cn in tn.Nodes) { if (cn.Data is UTPFCase) { UTPFCase c = (UTPFCase)cn.Data; if (c.FilePath == Properties.Settings.Default.LastUsedCaseFilePath) { tn.IsExpanded = true; // expand the parent node cn.IsActive = true; cn.IsSelected = true; break; } } } } } }