Skip to content

Commit 709645a

Browse files
committed
WPF Example - Remove commented out context menu code
Left over from when the built in wasn't working (it still only works partially) due to #1767 Improve comments and add links to make clearer
1 parent 41a6b83 commit 709645a

File tree

2 files changed

+4
-31
lines changed

2 files changed

+4
-31
lines changed

CefSharp.Wpf.Example/Handlers/MenuHandler.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ void IContextMenuHandler.OnContextMenuDismissed(IWebBrowser browserControl, IBro
5959

6060
bool IContextMenuHandler.RunContextMenu(IWebBrowser browserControl, IBrowser browser, IFrame frame, IContextMenuParams parameters, IMenuModel model, IRunContextMenuCallback callback)
6161
{
62-
//NOTE: Return false to use the build in Context menu - in WPF this requires you integrate into your existing message loop, read the General Usage Guide for more details
62+
//NOTE: Return false to use the built in Context menu - in WPF this requires you integrate into your existing message loop, read the General Usage Guide for more details
63+
//https://github.com/cefsharp/CefSharp/wiki/General-Usage#multithreadedmessageloop
6364
//return false;
6465

6566
var chromiumWebBrowser = (ChromiumWebBrowser)browserControl;
@@ -105,7 +106,8 @@ bool IContextMenuHandler.RunContextMenu(IWebBrowser browserControl, IBrowser bro
105106
Command = new RelayCommand(() =>
106107
{
107108
//BUG: CEF currently not executing callbacks correctly so we manually map the commands below
108-
//the following line worked in previous versions, it doesn't now, so custom EXAMPLE below
109+
//see https://github.com/cefsharp/CefSharp/issues/1767
110+
//The following line worked in previous versions, it doesn't now, so custom EXAMPLE below
109111
//callback.Continue(item.Item2, CefEventFlags.None);
110112

111113
//NOTE: Note all menu item options below have been tested, you can work out the rest

CefSharp.Wpf.Example/Views/BrowserTabView.xaml

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -436,35 +436,6 @@
436436
<RotateTransform Angle="{Binding Value, ElementName=angleSlider}" />
437437
</TransformGroup>
438438
</FrameworkElement.LayoutTransform>
439-
<!--<FrameworkElement.ContextMenu>
440-
<ContextMenu>
441-
<MenuItem Header="Back"
442-
Command="{Binding WebBrowser.BackCommand}" />
443-
<MenuItem Header="Forward"
444-
Command="{Binding WebBrowser.ForwardCommand}" />
445-
<Separator />
446-
<MenuItem Header="Print ..."
447-
Command="{Binding WebBrowser.PrintCommand}" />
448-
<Separator />
449-
<MenuItem Header="Zoom In"
450-
Command="{Binding WebBrowser.ZoomInCommand}" />
451-
<MenuItem Header="Zoom Out"
452-
Command="{Binding WebBrowser.ZoomOutCommand}" />
453-
<MenuItem Header="Zoom Reset"
454-
Command="{Binding WebBrowser.ZoomResetCommand}" />
455-
<Separator />
456-
<MenuItem Header="Show DevTools"
457-
Command="{Binding ShowDevToolsCommand}" />
458-
<MenuItem Header="Close DevTools"
459-
Command="{Binding CloseDevToolsCommand}" />
460-
<Separator />
461-
<MenuItem Header="View Source"
462-
Command="{Binding WebBrowser.ViewSourceCommand}" />
463-
<MenuItem Header="Cut" Command="{Binding WebBrowser.CutCommand}"/>
464-
<MenuItem Header="Copy" Command="{Binding WebBrowser.CopyCommand}"/>
465-
<MenuItem Header="Paste" Command="{Binding WebBrowser.PasteCommand}"/>
466-
</ContextMenu>
467-
</FrameworkElement.ContextMenu>-->
468439
</cefSharp:ChromiumWebBrowser>
469440
</Grid>
470441
</DockPanel>

0 commit comments

Comments
 (0)