Forked from cefsharptutorials/GettingSettingHTMLMainWindow.xaml.cs
Created
May 24, 2019 05:54
-
-
Save stephensmitchell/588aba87ef3324e51a48f7c52b14f54f 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