-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Closed
Labels
DoneThis issue has been fixedThis issue has been fixedarea-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor ComponentsenhancementThis issue represents an ask for new feature or an enhancement to an existing oneThis issue represents an ask for new feature or an enhancement to an existing one
Milestone
Description
Since we changed Router to have a NotFoundContent fragment instead of referencing a "fallback page" type, we've lost the convenience of having the content rendered inside a layout. It just renders very plainly (typically, black Times New Roman on a white screen).
This might not seem super important for the "not found" message, but we're also about to add "authorizing..." and "not authorized" content here too, and those really should be rendered inside a layout or the app will look flickery and weird as it jumps between displays styles.
Possible solution:
- We add an extra
DefaultLayoutproperty toRouter(of typeSystem.Type, just like we used to forFallbackComponent).- Usage in template:
<Router ... DefaultLayout="typeof(MainLayout)">
- Usage in template:
- We also add the same
DefaultLayoutproperty to theLayoutDisplaycomponent, and haveRouterautomatically pass the value through - Then we update the rendering logic for
LayoutDisplayso that, when the target doesn't define any layout, we use theDefaultLayouttype - Finally, we make
LayoutDisplayable to receive aRenderFragmentas an alternative to a page type, i.e., it supports either. ThenRoutercan render itsNotFoundContentby passing the render fragment toLayoutDisplay
Metadata
Metadata
Assignees
Labels
DoneThis issue has been fixedThis issue has been fixedarea-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor ComponentsenhancementThis issue represents an ask for new feature or an enhancement to an existing oneThis issue represents an ask for new feature or an enhancement to an existing one