Describe the solution you'd like
I moved from IContextMenuHandler to CefSharp.Wpf.Handler.ContextMenuHandler in order to avoid #1882.
As a result, the context menu now has the default WPF styling, which doesn't really fit Chrome or modern Windows.
I would like to be able to set the context menu's Style property; however, the context menu is instantiated ad-hoc, so this doesn't seem possible. I.e., I would like
- either a property
ContextMenuStyle on CefSharp.Wpf.ChromiumWebBrowser to set the style beforehand, then if set, have CefSharp.Wpf.Handler.ContextMenuHandler apply it
- or an event
ContextMenuCreated in CefSharp.Wpf.Handler.ContextMenuHandler which I can listen to
Describe alternatives you've considered
- implementing
IContextMenuHandler myself (or inheriting from CefSharp.Wpf.Handler.ContextMenuHandler. However, that seems like a lot of error-prone work.
- using
CefSharp.Wpf.Handler.ContextMenuHandler but overriding RunContextMenu to grab the created ContextMenu. This doesn't (seem to) work reliably due to timing issues.
Checklist:
Describe the solution you'd like
I moved from
IContextMenuHandlertoCefSharp.Wpf.Handler.ContextMenuHandlerin order to avoid #1882.As a result, the context menu now has the default WPF styling, which doesn't really fit Chrome or modern Windows.
I would like to be able to set the context menu's
Styleproperty; however, the context menu is instantiated ad-hoc, so this doesn't seem possible. I.e., I would likeContextMenuStyleonCefSharp.Wpf.ChromiumWebBrowserto set the style beforehand, then if set, haveCefSharp.Wpf.Handler.ContextMenuHandlerapply itContextMenuCreatedinCefSharp.Wpf.Handler.ContextMenuHandlerwhich I can listen toDescribe alternatives you've considered
IContextMenuHandlermyself (or inheriting fromCefSharp.Wpf.Handler.ContextMenuHandler. However, that seems like a lot of error-prone work.CefSharp.Wpf.Handler.ContextMenuHandlerbut overridingRunContextMenuto grab the createdContextMenu. This doesn't (seem to) work reliably due to timing issues.Checklist:
- [ ] The Feature I'm requesting is an improvement to Async Javascript Binding (No new feature are being added to the Sync Javascript binding)- [ ] An openPRexists on the CEF Pull Requests and I'd like to propose this feature is added toCefSharpwhen/if it's merged.