Created
September 16, 2015 02:34
-
-
Save aetos382/356d870b6c41ff5f5a2e to your computer and use it in GitHub Desktop.
This file contains 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
private void button_Click(object sender, RoutedEventArgs e) | |
{ | |
// ここは UI スレッドで実行される | |
Debug.WriteLine("button_Click : {0}", Thread.CurrentThread.ManagedThreadId); | |
var client = new WebClient(); | |
client.Encoding = Encoding.UTF8; | |
client.DownloadStringCompleted += this.OnDownloadStringCompleted; | |
client.DownloadStringAsync(new Uri("http://tech.blog.aerie.jp")); | |
} | |
private void OnDownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e) | |
{ | |
// ここも UI スレッドで実行されている | |
Debug.WriteLine("OnGetResponseCompleted : {0}", Thread.CurrentThread.ManagedThreadId); | |
this.webBrowser.NavigateToString(e.Result); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment