wpf里面的跨线程(thread)
2008-02-14  作者:amao  同分类文章
description:

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


相关
在WPF中减少逻辑与UI元素的耦合
wpf中控件绑定到程序里面实例化的对象
wpf里面的跨线程(thread)