Adding a additional context menu to windows 10 phone

280 views Asked by At

How to add context menu to windows phone 10's context menu.

Menu will get added when app is install & run for first time.

Clicking on that menu will open the app with provided data.

Is it possible in UWP ?

Context Menu in Edge mobile Context Menu in Edge mobile

1

There are 1 answers

2
Sunteen Wu On BEST ANSWER

How to add context menu to windows phone 10's context menu.

Actually every app in windows phone 10 has its own default context menu. Not all the app have the same context menu called 'windows phone 10 context menu'. For example, the people app's default context menus are "Edit","Delete" and so on, and the photo app's are "Share","Add to album" and so on. So you need to determine which app's context menu you need to added.

If you want add context menu for a uwp app you're developing, that is easy to do. In uwp app you can use PopupMenu to create a custom context menu and with UICommand to add menu items. Details please reference the context menu official sample. If you want to launch another app by selecting one item, you need to launch the app by Launcher class when the item selected. More details about how to launch an app please reference this sample.

If you want add context menu for Edge app as the picture you showed, you need to use the Microsoft Edge Extensions. That extension support context menu relative APIs like contextMenus.create method. Details please reference the supported APIs in the extension. Pay attention that the context menu APIs for Edge only support for Microsoft Edge (38) / Windows 10 (14393).

Same for other apps, if the app doesn't open an extension or public APIs, you cannot change the contextMenu directly.

Menu will get added when app is install & run for first time.

You cannot add a menu to another app when current app is first run since the uwp app is sandbox. For third party apps like Edge, you can only complete the extension and load it to explorer to let the context menu changes take effects, you cannot control it from your app.