所有的鸟儿他们都知道, 他们的巢应该筑在什么地方, 鸟儿知道自己该在什么地方筑巢, 那就意味着他们了解他们自己的使命。 我们身为万物之灵的人类, 怎么会不知道,连鸟儿都知道的道理呢?
wpf里面的跨线程(thread)
wpf里面的跨线程(thread)

wpf里面的跨线程(thread)

private void ForecastButtonHandler(object sender, RoutedEventArgs e)
{
    // Start fetching the weather forecast asynchronously.
    NoArgDelegate fetcher = new NoArgDelegate(
        this.FetchWeatherFromServer);

    fetcher.BeginInvoke(null, null);
}//见异步调用同步方法

private void FetchWeatherFromServer()
{

    // Schedule the update function in the UI thread.
    tomorrowsWeather.Dispatcher.BeginInvoke(
        System.Windows.Threading.DispatcherPriority.Normal,
        new OneArgDelegate(UpdateUserInterface),
        weather);

}//tomorrowsWeather是UI线程的一个control

WPF:
http://msdn2.microsoft.com/en-us/library/ms741870.aspx

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注