{"record":{"id":"78df4a012f90221b","repo":"PrismLibrary/Prism","slug":"journal","errorCode":null,"errorMessage":"journal","messagePattern":"journal","errorType":"exception","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"src/Maui/Prism.Maui/Navigation/Regions/Navigation/RegionNavigationService.cs","lineNumber":26,"sourceCode":"/// 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.\n    /// </summary>","sourceCodeStart":8,"sourceCodeEnd":44,"githubUrl":"https://github.com/PrismLibrary/Prism/blob/358118cd640d9a22ff8cf21c8ad197fa038b7990/src/Maui/Prism.Maui/Navigation/Regions/Navigation/RegionNavigationService.cs#L8-L44","documentation":"Thrown by the RegionNavigationService constructor when the IRegionNavigationJournal dependency is null. The journal tracks forward/back navigation for the region and the service immediately assigns Journal.NavigationTarget = this, so a null journal is rejected up front. Fail-fast guard on a required dependency.","triggerScenarios":"Calling new RegionNavigationService(container, loader, null) or a container registration resolving IRegionNavigationJournal to null.","commonSituations":"Hand-rolled construction in tests, custom journal registrations that are missing, arguments passed out of order.","solutions":["Pass a valid IRegionNavigationJournal instance (Prism registers RegionNavigationJournal by default).","Ensure UsePrism/PrismAppBuilder default registrations run before resolving the service.","Correct parameter ordering in manual construction."],"exampleFix":"// before\nvar svc = new RegionNavigationService(container, loader, null);\n// after\nvar svc = new RegionNavigationService(container, loader, new RegionNavigationJournal());","handlingStrategy":"validation","validationCode":"if (journal is null) throw new ArgumentNullException(nameof(journal));\nvar svc = new RegionNavigationService(container, loader, journal);","typeGuard":"bool IsValid(IRegionNavigationJournal j) => j is not null;","tryCatchPattern":null,"preventionTips":["Rely on Prism's default IRegionNavigationJournal registration.","In tests, construct a RegionNavigationJournal explicitly.","Keep constructor argument order consistent."],"tags":["null-argument","constructor","journal","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"}