public bool SetPathChecked(string fullPath) { if (fullPath.Equals(fFullPath, StringComparison.OrdinalIgnoreCase)) { IsChecked = true; return(true); } if (fullPath.StartsWith(fFullPath, StringComparison.OrdinalIgnoreCase)) { if (!fHasLoadedChildren) { LoadChildren(); } foreach (object item in Items) { FolderTreeViewItem tvm = item as FolderTreeViewItem; if (tvm != null) { if (tvm.SetPathChecked(fullPath)) { return(true); } } } } return(false); }