我有这段代码
public void BckGrwndWrkrInHst()
{
var BWLoad = new BackgroundWorker()
{ WorkerReportsProgress = true };
BWLoad.RunWorkerAsync();
BWLoad.DoWork += Bwload_DoWork;
BWLoad.ProgressChanged += Bwload_ProgressChanged;
}
和这三种方法:
private void Bwload_ProgressChanged(object sender, ProgressChangedEventArgs e)
{
LPrgrBar.Value = e.ProgressPercentage;
}
public void Bwload_DoWork(object sender, DoWorkEventArgs e)
{
method(/* dnw what to do */);
}
public void method(string a , string b)
{
//work to do
}
在另一个窗口,我有两个值a1和b1。
我想调用调用其他三种方法的BckGrwndWrkrInHst()
我想在method(a1,b1)
中返回a1和b1。我不知道该怎么做
(application.current.mainwindow as mainwindow).BckGrwndWrkrHst();