/// <summary> /// Requery all child items - this can be useful when we /// expand a folder for the very first time. Here we use task library with /// async to enable synchronization. This is for parts of other commands /// such as New Folder command which requires expansion of sub-folder /// items before actual New Folder command can execute. /// </summary> /// <param name="expandedItem"></param> /// <returns></returns> private async Task <bool> RequeryChildItems(FolderViewModel expandedItem) { await Task.Run(() => { expandedItem.ClearFolders(); // Requery sub-folders of this item expandedItem.LoadFolders(); }); return(true); }
public override async Task <int> ChildrenLoadAsync() { await Task.Run(() => { FolderViewModel.LoadFolders(this); }); return(base.ChildrenCount); }
/// <summary> /// Load all sub-folders into the Folders collection. /// </summary> public override void ChildrenLoad() { FolderViewModel.LoadFolders(this); }