public Page ResolveView <TViewModel, TViewModelParameter>(TViewModel viewModel = default, TViewModelParameter viewModelParameter = default) where TViewModel : class, IViewModel <TViewModelParameter> { var viewModelInstance = viewModel ?? dependencyInjectionService.Resolve <TViewModel>(new TypedParameter(typeof(TViewModelParameter), viewModelParameter)); var viewType = GetViewType(viewModelInstance); return(GetView(viewType, viewModelInstance)); }
public App(IEnumerable <IInstaller> installers = null) { InitializeComponent(); DependencyInjectionService = new DependencyInjectionService(); var navigationPage = new NavigationPage(); RegisterDependencies(DependencyInjectionService, navigationPage.Navigation, installers); var navigationService = DependencyInjectionService.Resolve <INavigationService>(); navigationService.PushAsync <HomeViewModel>(); MainPage = navigationPage; }
public void NavigateTo <TViewModel>(TViewModel viewModel = default) where TViewModel : class, IViewModel { var view = mvvmLocatorService.ResolveView(viewModel ?? dependencyInjectionService.Resolve <TViewModel>()); mainContentViewUpdater.SetMainContentView(view); }