在WPF应用程序中将数据传递给backgroundworker [英] passing data to backgroundworker in WPF application
问题描述
大家好,
我的WPF表单应用程序中有一堆文本框.我需要将数据从这些文本框传递到后台线程.我该怎么做呢?
i have bunch of textboxes in my WPF form app. i need to pass data from those textboxes to the background thread. how can i go about doing this?
非常感谢
http://msdn.microsoft.com/zh-cn/library/system.componentmodel.backgroundworker.aspx
http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx
推荐答案
BackgroundWorker的方法之一是RunWorkerAsync,它将对象作为参数.
One of the methods of the BackgroundWorker is the RunWorkerAsync which will take an object as a parameter.
该对象被传递到DoWork事件中,并且可以在BackgroundWorker线程中使用.
This object is passed into the DoWork event and can be used in the BackgroundWorker thread.
希望这会有所帮助
Lloyd Sheen
Lloyd Sheen
这篇关于在WPF应用程序中将数据传递给backgroundworker的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!