private void LoadOtherFileDetails(VideoFolder item, Dispatcher dispatcherunit) { if (item.FileType == FileType.Folder) { if (item.HasCompleteLoad) { return; } var task = Task.Factory.StartNew(() => GetItems(item)) .ContinueWith(t => item = t.Result, TaskScheduler.Current); task.Wait(); } else { var itemchild = (VideoFolderChild)item; Task task = Task.Factory.StartNew(() => { dispatcherService.BeginInvokeDispatchAction(dispatcherunit, new Action(delegate { //itemchild.IsLoading = true; FileLoader.GetShellInfo(itemchild); })); }) .ContinueWith(t => { //itemchild.IsLoading = false; itemchild.UpdateProperties(); }, TaskScheduler.Current); task.Wait(); itemchild.IsLoading = false; } }