Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prism Xamarin Forms injectable objects

I'm new to Prism and I'm looking for some guidance on the objects available during viewModel instantiation when using Prism (Prism.Forms 6.2.0 Preview 3) with Xamarin Forms.

I see that INavigationService and IEventAggregator parameters values are supplied by the framework when navigating to a view/viewmodel. See code below for an illustration.

 public ViewBViewModel(INavigationService navigationService, IEventAggregator ea)
    {
        _ea = ea;
        _navigationService = navigationService;
    }

The navigationService and ea objects (above) were populated by Prism.

Question: What other objects can be auto-populated in a viewModel instance by the framework (outside of INavigationService and IEventAggregator)? Thanks.

like image 813
lyndon hughey Avatar asked Sep 21 '26 09:09

lyndon hughey


1 Answers

It looks like these are the implementations registered for you:

  • INavigationService
  • IApplicationProvider
  • IModuleManager
  • IModuleInitializer
  • IEventAggregator
  • IDependencyService
  • IPageDialogService
  • ILoggerFacade

See source here.

That being said, I'm only familiar with INavigationService, IEventAggregator and IPageDialogService. ILoggerFacade looks interesting.

See documentation here.

like image 89
therealjohn Avatar answered Sep 23 '26 21:09

therealjohn



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!