Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save cefsharptutorials/42da4d1722ecf39d7f72d6d05fd232b6 to your computer and use it in GitHub Desktop.

Select an option

Save cefsharptutorials/42da4d1722ecf39d7f72d6d05fd232b6 to your computer and use it in GitHub Desktop.
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void BrowserView_OnFrameLoadEnd(object sender, FrameLoadEndEventArgs e)
{
//Please note that the delegate is marked as ‘async’
Dispatcher.BeginInvoke((Action) (async () =>
{
//Here we asynchronously get the HTML content of the browser
HtmlTextBox.Text = await BrowserView.GetSourceAsync();
}));
}
private void SetHtmlButton_OnClick(object sender, RoutedEventArgs e)
{
//Synchronously set the HTML content of the browser
BrowserView.LoadHtml(HtmlTextBox.Text);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment