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));
        }
Beispiel #2
0
        private static async ValueTask <IMvxViewModel> GetViewModel(MvxViewPagerFragmentInfo fragmentInfo)
        {
            if (fragmentInfo.Request is MvxViewModelInstanceRequest instanceRequest)
            {
                return(instanceRequest.ViewModelInstance);
            }

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

            return(await viewModelLoader.LoadViewModel(fragmentInfo.Request, null).ConfigureAwait(false));
        }
        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);
        }