将结果返回到我使用Mvvmcross 5和Xamarin.Forms导航的位置

时间:2017-06-15 09:05:05

标签: xamarin.forms mvvmcross

我对Mvvmcross5文档中的此示例有疑问:

public class MyViewModel : MvxViewModel
{
    private readonly IMvxNavigationService _navigationService;
    public MyViewModel(IMvxNavigationService navigation)
    {
        _navigationService = navigationService;
    }

    public async Task SomeMethod()
    {
        var result = await _navigationService.Navigate<NextViewModel, MyObject, MyReturnObject>(new MyObject());
        //Do something with the result MyReturnObject that you get back
    }
}

public class NextViewModel : MvxViewModel<MyObject, MyReturnObject>
{
    public async Task Initialize(MyObject parameter)
    {
        //Do something with parameter
    }

    public async Task SomeMethod()
    {
        await Close(new MyReturnObject());
    }
}

它似乎与Mvvmcross项目的简单Xamarin应用程序一起使用。现在,我需要将它与Xamarin.Forms一起使用:调用close方法但在显示上一页后,没有任何反应:/

在输出中:“请求演示更改”可能是一个线索?

0 个答案:

没有答案