Reputation: 1994
I want to integrate my app into the windows explorer. The users should be able to select more than one image and call from the context menue the option “resize”. Therefore I created the following windows.fileTypeAssociation
<uap:Extension Category="windows.fileTypeAssociation">
<uap3:FileTypeAssociation Name="bla" >
<uap2:SupportedVerbs>
<uap3:Verb Id="Resize" Extended="false" MultiSelectModel="Player">Resize</uap3:Verb>
<uap3:Verb Id="Edit1" Extended="false" MultiSelectModel="Player">Edit1</uap3:Verb>
</uap2:SupportedVerbs>
<uap:SupportedFileTypes>
<uap:FileType>.jpg</uap:FileType>
<uap:FileType>.txt</uap:FileType>
<uap:FileType>.banana</uap:FileType>
<uap:FileType>.foo</uap:FileType>
</uap:SupportedFileTypes>
</uap3:FileTypeAssociation>
</uap:Extension>
If the user right clicks on a .jpg or .txt file the context menu doesn’t contain the menu items “Resize” and “Edit1”. On the opposite it works for files with the extension .banana and .foo. The banana file typ extension is associated with another uwp app named bananaedit. The extension .foo is only related to my app. Why can’t I associate or integrate my context menu items with .jpg or txt filetypes?
How integrate uwp app into context menu of windows explorer for jpg?
[EDIT]
Uservoice request for Allow context menu verbs with file explorer integration without setting the app as default for the file type
[Edit2] upvote this feature here (Feedbackhub) integrate context menu into windows explorer 4 #uwp
[Edit3] upvote this feature on github ProjectReunion
Upvotes: 4
Views: 1016
Reputation: 3808
It doesn't have any problems with your code. You just need to make some change on your device default app settings.
In your device, it has installed the system application Photos app and it is also the default app for the .jpg file type in your device, the Photos app doesn't include the Resize and Edit1 options, so when you right click the .jpg file, the context menu doesn’t contain the menu items "Resize" and "Edit1", so as the .txt file format whose default file type app is Notepad.
As for the .foo and .banana file types, your app has been set as default app for these file type automatically when you app associate the file type(your app maybe the only one which associates the file type), so you can see the "Resize" and "Edit1" options when you right click the .foo and .banana file.
You can check this on your device Settings app => Apps => Default apps => Choose default apps by file type as the following image,
So if you want the context menu contain your menu items "Resize" and "Edit1" when right cick the .jpg or .txt file, you should direct the user to set your app as the default app of the .jpg and .txt file type. You can use the launch Apis to provide the user a convenient link to the privacy settings for that resource, see the topic Launch the Windows Settings app.
Upvotes: 2