Reputation: 681
Currently I'm developing an app where at the end of a message I want to show a list with attachments. These attachments can be downloaded and/or opened in some external app on the phone.
I'd like to show some graphic next to the filename, just like your average mail client would do. My question is how do I retrieve the icon associated with a mimetype or file extension. I.e for attachment spreadsheet.xlsx
I'd like to the 'Office' or 'Excel' logo/icon that's registered with the system.
My googling skills couldn't find any solution working on windows phone 8. I think it should be possible since the documentation describes how to associate your app with a file including supplying a logo to display. (source)
I'd try StorageFile.GetThumbnailAsync but it's not supported on windows phone 8 but intellisence came up with this line in the documentation: "This API is not implemented and will throw an exception if called." It's only supported from WP8.1.
Any help would be greatly appreciated :)
Edit
I know StorageFile.GetThumbnailAsync is only available from WP 8.1
My question is: is it possible on WP 8.0? I want my app to work on at least WP 8.0 and if possible I want to add WP 7 support as well.
Upvotes: 2
Views: 697
Reputation: 2947
Looks like you're out of luck. Keep an eye on Windows 8.1 user share and drop support for Windows 8.0 if you can, so you can use the StorageFile.GetThumbnailAsync
call.
My solution would be to make a few default icons for the file types that are used most often, with a general fallback to a generic document icon.
Upvotes: 1