title: Call this.StateHasChanged in EventHandler
body: <p>I have the following problem.
  I created an event and subscribe to it, now I want that the UI changes when the Event triggers.</p>
  
  <pre><code> using System;
   using MintWebApp.Data;
   using MintWebApp.Models;
   using Microsoft.AspNetCore.Components;
   namespace WebApp.UI.Core
   {
      public partial class AppHeader
      {
          public string status { get; set; }
          [Inject]
          public StateService state { get; set; }
  
          EventHandler&lt;string&gt; onStatusChanged= (sender, eventArgs) =&gt; {
  
              //Here i get the error, I can't access this and status
              status = eventArgs;
              this.StateHasChanged();
              Console.WriteLine(eventArgs.PatientName);
          };
  
          protected override void OnInitialized() =&gt; state.StatusHandler += onStatusChanged;
      }
  
  }
  </code></pre>
  
  <p>I get this Error
  A field initializer cannot reference the non-static field, method, or property 'AppHeader.patientContext'</p>
  
  <p>Keyword 'this' is not available in the current context</p>
  
  <p>How can I subscripe to an event and update the UI</p>