private static LocalDirectoryViewModel CreateDirectoryViewModel(ILocalItem storageItem) { return(new LocalDirectoryViewModel { StorageItem = storageItem }); }
private static LocalFileViewModel CreateFileViewModel(ILocalItem storageItem) { return(new LocalFileViewModel { StorageItem = storageItem, }); }
public Task <ILocalItem> TryGetItemAsync(string name) { return(_storageFolder.TryGetItemAsync(name) .AsTask() .ContinueWith( storageItem => { var item = storageItem.Result; ILocalItem localItem = null; if (item == null) { return localItem; } if (item.IsOfType(StorageItemTypes.File)) { localItem = new LocalFile((StorageFile)item); } if (item.IsOfType(StorageItemTypes.Folder)) { localItem = new LocalDirectory((StorageFolder)item); } return localItem; })); }