示例#1
0
        private static IMvxViewModel GetViewModel(MvxViewPagerFragmentInfo fragmentInfo)
        {
            if (fragmentInfo.Request is MvxViewModelInstanceRequest instanceRequest)
            {
                return(instanceRequest.ViewModelInstance);
            }

            var viewModelLoader = Mvx.IoCProvider.Resolve <IMvxViewModelLoader>();

            return(viewModelLoader.LoadViewModel(fragmentInfo.Request, null));
        }
示例#2
0
        private static Bundle GetArguments(MvxViewPagerFragmentInfo fragmentInfo)
        {
            var navigationSerializer = Mvx.IoCProvider.Resolve <IMvxNavigationSerializer>();

            var serializedRequest = navigationSerializer.Serializer.SerializeObject(fragmentInfo.Request);

            var bundle = new Bundle();

            bundle.PutString(MvxAndroidViewPresenter.ViewModelRequestBundleKey, serializedRequest);

            return(bundle);
        }