Esempio n. 1
0
        private async Task InternalNavigateToAsync <TPage, TViewModel, TParam>(TParam parameter, bool modal, bool animated)
            where TPage : Page, new()
            where TViewModel : BaseViewModel
        {
            var viewModel = _viewModelLocator.Resolve <TViewModel, TParam>(parameter);

            await CanNavigate <TPage, TViewModel>(viewModel, modal, animated);
        }
        private Page PageFromVM <TViewModel>()
        {
            var viewType = viewModelLocator.Resolve <TViewModel>();
            var view     = (Page)ActivatorUtilities.CreateInstance(serviceProvider, viewType);

            view.BindingContext = ActivatorUtilities.CreateInstance <TViewModel>(serviceProvider);
            return(view);
        }