The first one works, but the latter two do not. I thought that all 3 possibilities are the same, maybe someone can throw me in the right direction and why the two do not work? What I want is a Navigation object, not building it via config.
Thx in advance :)
Can you explain what "does not work" means?
I've created something very similar and that works as expected. I have a few differences, but they all have no influence on the working:
1. My "ModuleNamespace\Model\Navigation" is just called in the invokables from the SM, so no factory is required
2. I call parent::__construct(), but if you don't have a page config array, that call does not really matter
3. I create Uri pages with the factory
Therefore I think you have problems with your route assembly. You do not provide a router, so you have set the default router? You do not provide a route for the pages either, so you use one route (like a "magic route")? If you do not have a route set, the name of the route in the route match will be used. You can assemble an uri with the route match, but if the page from the navigation has a different route than the route from the match, that will not work. However, to let this happen you must also set a route match, which you do not as well.
For all these cases (no router set, no route or route match set, assembly fails) you will get an exception, so all failures are clearly visible.