【发布时间】:2015-11-05 17:18:43
【问题描述】:
我有 PageA + ViewModelA 和 PageB + ViewModelB。
我从 A 调用 PushAsync(B),编辑一些数据,然后调用 PopAsync()。
所以现在 B 关闭,用户返回 A。
但是在 B 中,用户更改了一些状态,应该在 A 上更新。通知 A 更新状态的正确方法是什么(最好能够访问 ViewModelB)。
方法:
1. In B call PopAsync(), from NavigationStack get ViewModelA and manually trigger some update method
2. [doesn't work for me] In A call PushAsync(B) and wait until B becomes closed, so after that perform update with access to VMB (PushAsync doesn't lock A, so this approach doesn't work)
似乎这两种方法都不正确。
【问题讨论】:
标签: xamarin xamarin-forms