Ejemplo n.º 1
0
        public static void LoadViewModelFrom(this Android.Views.IMvxFragmentView view, MvxViewModelRequest request, IMvxBundle savedState = null)
        {
            var loader    = Mvx.IoCProvider.Resolve <IMvxViewModelLoader>();
            var viewModel = loader.LoadViewModel(request, savedState);

            if (viewModel == null)
            {
                MvxLogHost.Default?.Log(LogLevel.Warning, "ViewModel not loaded for {viewModelType}", request.ViewModelType.FullName);
                return;
            }

            view.ViewModel = viewModel;
        }
Ejemplo n.º 2
0
        public static void LoadViewModelFrom(this Android.Views.IMvxFragmentView view, MvxViewModelRequest request, IMvxBundle savedState = null)
        {
            var loader    = Mvx.Resolve <IMvxViewModelLoader>();
            var viewModel = loader.LoadViewModel(request, savedState);

            if (viewModel == null)
            {
                MvxLog.Instance.Warn("ViewModel not loaded for {0}", request.ViewModelType.FullName);
                return;
            }

            view.ViewModel = viewModel;
        }
Ejemplo n.º 3
0
        public static async ValueTask LoadViewModelFrom(this Android.Views.IMvxFragmentView view, MvxViewModelRequest request, IMvxBundle?savedState = null)
        {
            var loader    = Mvx.IoCProvider.Resolve <IMvxViewModelLoader>();
            var viewModel = await loader.LoadViewModel(request, savedState).ConfigureAwait(false);

            if (viewModel == null)
            {
                MvxLog.Instance.Warn("ViewModel not loaded for {0}", request.ViewModelType.FullName);
                return;
            }

            view.ViewModel = viewModel;
        }