Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Blazor export property of a component to another one

$
0
0

Ive been trying to use foolgpt aswell as other online guides on how to cascade ( or manage some sort of state manager ) in order to control the property of one component from another.

Basically I have the mainlayout which is the father UI of the program.This is part of it:

<div class="sidebar" hidden="@(!state.isAutenticate)" ><NavMenu /></div><main><div class="top-row px-4" style="text-align:center;display:inherit !important; "><h1><b></b></h1><table><tr>                        @if (state.UserObj != null )                        {<td>Hello: </td><td> @(state.UserObj.FirstName  +" " +  state.UserObj.LastName) </td>                        }</tr></table></div><button hidden="@isMenuBtnHidden" > test </button>

There I have a buttons, which I want to be hidden. that's why I set the value of isMenuBtnHidden to false.

I have the nav menu ( as you can see, it is used here too in the second line )and there I simply have a many with links such as:

<div class="nav-item px-3"<NavLink class="nav-linkhref="sklk_read_inp_av">testNav</NavLink></div>

I want to add a method to that Navlink that will toggle the visibility of the button found in the Mainlayout.So , lets say, whenever a Navmenu click is made, and it refers be to a page ( using href), I want at the same time to display a button that will redirect me back to the Navmenu page ( /home ).

Ive been trying for a long time to do that but it seems Im lacking the knowledge or the unbderstanding of what Im doing wrong.

Any solutions will be highly appreciated.Thanks and have a nice day.


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>