简体   繁体   中英

How to get the views related to a viewmodel in MugenMvvm

如何与Mugen Mvvm结合使用Xamarin.Ios中与视图模型相关的视图?

It seems like IViewAwareViewModel in MugenMvvm has a View property you can use.

Otherwise there seems to be an extension method GetCurrentView<T>() which gives you the View of the ViewModel.

所以我解决了这个问题,内置了ViewModelToViewConverter。

var view = ViewModelToViewConverter.Instance.Convert(viewModel);

您可以使用IViewMappingProvider.FindMappingForViewModel方法按视图模型类型获取视图类型,也可以使用IViewManager.GetOrCreateView为视图模型创建视图。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM