Try using something like MVVM:
Create a class that stores all the data displayed in the current "view" (window, page, which makes sense for your application).
Associate your control with an instance of this class.
Ask the class to set some ICommand properties, bind the Button property to the corresponding property in the data class, you do not need to set the command parameter, because all the data has already been transferred to the object using normal daily data binding.
Get a class based on ICommand that calls you into an object, look at this link for a few implementations:
http://dotnet.org.za/rudi/archive/2009/03/05/the-power-of-icommand.aspx
Inside the method called by the command, pack all the necessary data and send it to the background thread.
source share