title: Change visibility of nav item in blazor menu
body: <p>I'm using Blazor with .NET Core 3.0.
  I want to show a login in my menu, when the user isn't logged in yet. When he is logged in, then the login nav item should be hidden. How can I do this?</p>
  
  <p>EDIT:
  I changed the OnInitializedAsync method by using async Task, but this is not the problem. For the first load, it works correctly. But then i go to the login page, log me in and Navigate to the home page via NavigationManager, the menu will not be "refreshed". How can I solve this?</p>
  
  <p>Following code is not working...</p>
  
  <pre><code>&lt;div&gt;
      &lt;ul class="nav flex-column"&gt;
          &lt;li class="nav-item px-3"&gt;
              &lt;NavLink class="nav-link" href="" Match="NavLinkMatch.All"&gt;
                  &lt;span class="oi oi-home" aria-hidden="true"&gt;&lt;/span&gt; Home
              &lt;/NavLink&gt;
          &lt;/li&gt;
          @if (!_isLoggedIn)
          {
              &lt;li class="nav-item px-3"&gt;
                  &lt;NavLink class="nav-link" href="login"&gt;
                      &lt;span class="oi oi-person" aria-hidden="true"&gt;&lt;/span&gt; &lt;LocalizedString Key="NavMenuLogin" /&gt;
                  &lt;/NavLink&gt;
              &lt;/li&gt;
              &lt;li class="nav-item px-3"&gt;
                  &lt;NavLink class="nav-link" href="licenseedit"&gt;
                      &lt;span class="oi oi-spreadsheet" aria-hidden="true"&gt;&lt;/span&gt; &lt;LocalizedString Key="NavMenuRegistration" /&gt;
                  &lt;/NavLink&gt;
              &lt;/li&gt;
          }
      &lt;/ul&gt;
  &lt;/div&gt;
  
  @code{
  
      private bool _isLoggedIn;
  
      protected override async Task OnInitializedAsync()
      {
          await base.OnInitializedAsync();
          await TokenExistAsync();
      }
  
      private async Task TokenExistAsync()
      {
          var retVal = await Http.GetStringAsync("api/Login/ExistToken");
          _isLoggedIn = retVal == "yes";
      }
  
  }
  </code></pre>