Created
December 28, 2017 16:38
-
-
Save cefsharptutorials/42da4d1722ecf39d7f72d6d05fd232b6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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