Skip to content

Adding Properties and Events in Layout @Body #10230

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
tsmccartan opened this issue May 14, 2019 · 1 comment
Closed

Adding Properties and Events in Layout @Body #10230

tsmccartan opened this issue May 14, 2019 · 1 comment
Labels
area-blazor Includes: Blazor, Razor Components question

Comments

@tsmccartan
Copy link

In the default Blazor App, is it possible to hide/show Menu Items in the NavMenu.razor (

) from a Button Click in the Index.razor file?

I don't know how to control the razor file that is loaded into the @Body area by default? I believe it has to do with the @route "/". I have data being loaded there with a selection list of items. And based on what the user chooses, I want to show/hide navigation items in the NavMenu.

Is this possible?
How do you determine the default razor page that is loaded in the @Body area of the layout?
If I add a component in the Layout you can add Parameters, etc. <Components "@MyParam"> /> but I don't know if this is possible with the default index.razor that is being loaded by default in the @Body?

Thanks,
Tom

@Eilon Eilon added the area-blazor Includes: Blazor, Razor Components label May 14, 2019
@mkArtakMSFT
Copy link
Member

Thanks for contacting us, @tsmccartan.
You can achieve this using either a service registered in DI and passed to different pages, or using CascadingParameter-s.
Also we're trying to address and simplify this as part of the work we're tracking at #10131

@ghost ghost locked as resolved and limited conversation to collaborators Dec 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components question
Projects
None yet
Development

No branches or pull requests

3 participants