{"record":{"id":"93837566302361b0","repo":"PrismLibrary/Prism","slug":"the-method-or-operation-is-not-implemented","errorCode":null,"errorMessage":"The method or operation is not implemented.","messagePattern":"The method or operation is not implemented\\.","errorType":"exception","errorClass":"NotImplementedException","httpStatus":null,"severity":"error","filePath":"src/Maui/Prism.Maui/Navigation/Regions/Region.cs","lineNumber":166,"sourceCode":"    public IRegionManager RegionManager\n    {\n        get => _regionManager;\n        set => SetProperty(ref _regionManager, value);\n    }\n\n    /// <summary>\n    /// Gets the collection of <see cref=\"IRegionBehavior\"/>s that can extend the behavior of regions.\n    /// </summary>\n    public IRegionBehaviorCollection Behaviors { get; }\n\n    /// <summary>\n    /// Gets the navigation service.\n    /// </summary>\n    /// <value>The navigation service.</value>\n    public IRegionNavigationService NavigationService\n    {\n        get => _regionNavigationService;\n        set => throw new NotImplementedException();\n    }\n\n    /// <summary>\n    /// Gets the collection with all the views along with their metadata.\n    /// </summary>\n    /// <value>An <see cref=\"ObservableCollection{T}\"/> of <see cref=\"ItemMetadata\"/> with all the added views.</value>\n    protected virtual ObservableCollection<ItemMetadata> ItemMetadataCollection\n    {\n        get\n        {\n            if (_itemMetadataCollection == null)\n            {\n                _itemMetadataCollection = new ObservableCollection<ItemMetadata>();\n            }\n\n            return _itemMetadataCollection;\n        }\n    }","sourceCodeStart":148,"sourceCodeEnd":184,"githubUrl":"https://github.com/PrismLibrary/Prism/blob/358118cd640d9a22ff8cf21c8ad197fa038b7990/src/Maui/Prism.Maui/Navigation/Regions/Region.cs#L148-L184","documentation":"Region.NavigationService's setter is intentionally unimplemented and always throws NotImplementedException. The navigation service is populated by Prism's region behaviors, not by user code; the getter returns the injected service. Assigning the property directly is not a supported operation.","triggerScenarios":"Writing region.NavigationService = someService in application or test code.","commonSituations":"Custom region adapters trying to wire navigation manually; code ported from older Prism versions where the property behaved differently; developers attempting to substitute a mock navigation service in tests.","solutions":["Remove the assignment — region behaviors inject the navigation service automatically.","To customize, register the RegionNavigationRegistration behavior via the region behavior factory in a custom IRegionAdapter / container registration.","In tests, mock IRegionNavigationService and let Prism's behaviors attach it rather than assigning the property."],"exampleFix":"// before\nregion.NavigationService = myNavigationService;\n// after\n// rely on Prism behaviors; if customizing, register the behavior:\nregionBehaviors.AddIfMissing<RegionNavigationRegistrationBehavior>();","handlingStrategy":"validation","validationCode":"// Never assign; verify the navigation service was injected by Prism behaviors:\nif (region.NavigationService is null)\n    throw new InvalidOperationException(\"Navigation service not attached by region behaviors\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never set Region.NavigationService directly.","Let Prism's RegionNavigationRegistrationBehavior inject the service.","In custom adapters, register behaviors via the RegionBehaviorFactory rather than assigning properties."],"tags":["not-implemented","region","navigation","prism"],"backgroundTag":"method-not-implemented","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"}