如何让视图模型将数据返回给另一个? [英] How make a viewmodel return data to another?

查看:12
本文介绍了如何让视图模型将数据返回给另一个?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我调用 DoClose() 时,我试图找到一种将数据从一个视图模型传回另一个视图模型的解决方案

I'm trying to find a solution to passing back data from a viewmodel to another when I call DoClose()

我有一个视图,用户可以在编辑文本中添加信息,还有一个按钮可以打开一个新视图,用户可以在其中输入其他信息.然后他需要返回(DoClose())到第一个视图,然后点击按钮保存信息.

I've got a view where the user can add informations in edittext, there is also a button that open a new view where the user can enter others informations. Then he need to go back (DoClose()) to the first view and there click on the button to save informations.

我尝试创建一个 RequestNavigate<> 但它在堆栈中创建了一个新视图.

I tried to make a RequestNavigate<> but it create a new view in stack.

我不知道如何从第二个视图中取回信息.有人可以帮助我吗?

I don't know how can I get back the informations from the second view. Someone can help me ?

推荐答案

@gshackles 的这篇文章提供了一种实现此目的的机制 - http://www.gregshackles.com/2012/11/returning-results-from-view-models-in-mvvmcross/

This article from @gshackles gives one mechanism for doing this - http://www.gregshackles.com/2012/11/returning-results-from-view-models-in-mvvmcross/

这篇关于如何让视图模型将数据返回给另一个?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆