WP异步传递参数

异步调用

public async void AsyncSearchDataStart()
{
int res = await WaitSearchData();//等待调用完成
if (res == 1)
{
int ret = App.g_NAVI_Interface.NAVI_GetSearchData();
if (ret == 1)
{

}

}
else
{

}
}

public Task<int> WaitSearchData()
{
var task = new Task<int>(() =>//返回 //异步调用
{
});
task.Start();
return task;

}

 

//异步调用传参数

public Task<int> WaitSearchData(double xx, double yy)
{
var task = new Task<int>(() => abc(xx, yy)
task.Start();
return task;

}

int abc(double xx, double yy)

{

    return 0;

}

posted @ 2012-11-20 17:13  藏这儿  阅读(206)  评论(0编辑  收藏  举报