{"record":{"id":"cc1ce599f0e67f04","repo":"PrismLibrary/Prism","slug":"regionnavigationcontentloader","errorCode":null,"errorMessage":"regionNavigationContentLoader","messagePattern":"regionNavigationContentLoader","errorType":"exception","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"src/Maui/Prism.Maui/Navigation/Regions/Navigation/RegionNavigationService.cs","lineNumber":25,"sourceCode":"/// <summary>\n/// Provides navigation for regions.\n/// </summary>\npublic class RegionNavigationService : IRegionNavigationService\n{\n    private readonly IContainerProvider _container;\n    private readonly IRegionNavigationContentLoader _regionNavigationContentLoader;\n    private NavigationContext _currentNavigationContext;\n\n    /// <summary>\n    /// Initializes a new instance of the <see cref=\"RegionNavigationService\"/> class.\n    /// </summary>\n    /// <param name=\"container\">The <see cref=\"IContainerExtension\" />.</param>\n    /// <param name=\"regionNavigationContentLoader\">The navigation target handler.</param>\n    /// <param name=\"journal\">The journal.</param>\n    public RegionNavigationService(IContainerExtension container, IRegionNavigationContentLoader regionNavigationContentLoader, IRegionNavigationJournal journal)\n    {\n        _container = container ?? throw new ArgumentNullException(nameof(container));\n        _regionNavigationContentLoader = regionNavigationContentLoader ?? throw new ArgumentNullException(nameof(regionNavigationContentLoader));\n        Journal = journal ?? throw new ArgumentNullException(nameof(journal));\n        Journal.NavigationTarget = this;\n    }\n\n    /// <summary>\n    /// Gets or sets the region.\n    /// </summary>\n    /// <value>The region.</value>\n    public IRegion Region { get; set; }\n\n    /// <summary>\n    /// Gets the journal.\n    /// </summary>\n    /// <value>The journal.</value>\n    public IRegionNavigationJournal Journal { get; private set; }\n\n    /// <summary>\n    /// Raised when the region is about to be navigated to content.","sourceCodeStart":7,"sourceCodeEnd":43,"githubUrl":"https://github.com/PrismLibrary/Prism/blob/358118cd640d9a22ff8cf21c8ad197fa038b7990/src/Maui/Prism.Maui/Navigation/Regions/Navigation/RegionNavigationService.cs#L7-L43","documentation":"Thrown by the RegionNavigationService constructor when the IRegionNavigationContentLoader dependency is null. The content loader is responsible for creating/locating the target view for a navigation request, so the service cannot navigate without it. Fail-fast guard on a required constructor argument.","triggerScenarios":"Calling new RegionNavigationService(container, null, journal) or resolving a container registration that yields null for IRegionNavigationContentLoader.","commonSituations":"Unit tests constructing the service by hand, missing RegionNavigationContentLoader registration in a custom container setup, swapped constructor arguments.","solutions":["Pass a valid IRegionNavigationContentLoader (e.g. RegionNavigationContentLoader registered in the container).","Ensure Prism's default registrations are applied via UsePrism/PrismAppBuilder so the loader is resolvable.","Fix argument ordering in manual constructions."],"exampleFix":"// before\nvar svc = new RegionNavigationService(container, null, journal);\n// after\nvar svc = new RegionNavigationService(container, new RegionNavigationContentLoader(container), journal);","handlingStrategy":"validation","validationCode":"if (loader is null) throw new ArgumentNullException(nameof(loader));\nvar svc = new RegionNavigationService(container, loader, journal);","typeGuard":"bool IsValid(IRegionNavigationContentLoader l) => l is not null;","tryCatchPattern":null,"preventionTips":["Register IRegionNavigationContentLoader explicitly in custom container setups.","Avoid manual construction; resolve via container.","Double-check constructor argument order."],"tags":["null-argument","constructor","navigation","prism"],"backgroundTag":"null-argument","analyzedSha":"358118cd640d9a22ff8cf21c8ad197fa038b7990","analyzedAt":"2026-09-15T15:00:31.079Z","contentChangedAt":"2026-09-15T15:00:31.079Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}