Jeff T.
Jeff T.

Reputation: 2271

In metro, what's the difference between FolderInformation and StorageFolder

FolderInformation's methods/properties are nearly the same with StorageFolder's. I can't figure out why WinRT api provides FolderInformation and StorageFolder as well. If I assign the list created from FileInformationFactory.GetFoldersAsync() to an ItemsControl, does it differ from the listed created from StorageFolder.CreateFolderAsync() ? The document says the FolderInformation provides synchronous access, but I don't know when the issue would happen.

The one drawback I found in FolderInformation is it could only be created from FileInformationFactory. So I think it's impossible to create a FolderInformation for the KnownFolders.PicturesLibrary.

Upvotes: 2

Views: 289

Answers (1)

Raman Sharma
Raman Sharma

Reputation: 4581

FolderInformation lets you act on the Folder itself (as in move it, delete it, rename it etc.) http://msdn.microsoft.com/en-us/library/windows/apps/windows.storage.bulkaccess.folderinformation.aspx

Whereas StorageFolder lets you act on the contents of the folder (as in create a new file in the folder, create a new sub-folder in the folder, get all the files from the folder etc.) http://msdn.microsoft.com/en-us/library/windows/apps/windows.storage.storagefolder.aspx

Upvotes: 2

Related Questions