private async void FolderTracker_Created(object sender, FileSystemChangeSet e) { foreach (StorageFolder NewFolder in e.StorageItems) { e.ParentNode.Children.Add(new TreeViewNode { Content = NewFolder, HasUnrealizedChildren = (await NewFolder.GetFoldersAsync()).Count != 0 }); } }
private async void FolderTracker_Renamed(object sender, FileSystemRenameSet e) { foreach (var SubNode in from StorageFolder OldFolder in e.ToDeleteFileList from SubNode in from SubNode in e.ParentNode.Children where (SubNode.Content as StorageFolder).FolderRelativeId == OldFolder.FolderRelativeId select SubNode select SubNode) { e.ParentNode.Children.Remove(SubNode); } foreach (StorageFolder NewFolder in e.ToAddFileList) { e.ParentNode.Children.Add(new TreeViewNode { Content = NewFolder, HasUnrealizedChildren = (await NewFolder.GetFoldersAsync()).Count != 0 }); } }