2015-11-05 61 views
0

我有PageA + ViewModelA和PageB + ViewModelB。在INavigation.PopAsync()Xamarin表單中獲得控制

從我打電話PushAsync(B),編輯一些數據,並調用PopAsync()。

所以現在B變成關閉,用戶返回到A.

但在B的用戶改變了一些狀態,這應該是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) 

似乎這兩種方法是不正確的。

回答