Closed jbp199 closed 8 months ago
Example shown here missing a semicolon on second to last closure:
webView.CoreWebView2.ContextMenuRequested += delegate (object sender, CoreWebView2ContextMenuRequestedEventArgs args) { // add new item to end of collection CoreWebView2ContextMenuItem newItem = webView.CoreWebView2.Environment.CreateContextMenuItem( "Display Page Uri", null, CoreWebView2ContextMenuItemKind.Command); newItem.CustomItemSelected += delegate (object send, Object ex) { string pageUri = args.ContextMenuTarget.PageUri; System.Threading.SynchronizationContext.Current.Post((_) => { MessageBox.Show(pageUri, "Page Uri", MessageBoxButton.OK); }, null); }; <<---- semi colon missing menuList.Insert(menuList.Count, newItem); };
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
AB#48412524
Thanks for filing this issue. I've opened a PR to fix it.
Example shown here missing a semicolon on second to last closure:
webView.CoreWebView2.ContextMenuRequested += delegate (object sender, CoreWebView2ContextMenuRequestedEventArgs args) { // add new item to end of collection CoreWebView2ContextMenuItem newItem = webView.CoreWebView2.Environment.CreateContextMenuItem( "Display Page Uri", null, CoreWebView2ContextMenuItemKind.Command); newItem.CustomItemSelected += delegate (object send, Object ex) { string pageUri = args.ContextMenuTarget.PageUri; System.Threading.SynchronizationContext.Current.Post((_) => { MessageBox.Show(pageUri, "Page Uri", MessageBoxButton.OK); }, null); }; <<---- semi colon missing menuList.Insert(menuList.Count, newItem); };
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
AB#48412524