title: How to change Button Text by calling another component method in Blazor
body: <p>I have a custom Button component like below.</p>
  <pre><code>&lt;button class=&quot;btn btn-outline-primary&quot; @onclick=&quot;OnClick&quot;&gt; @ButtonText&lt;/button&gt;
  
  @code {
  
      [Parameter]
      public string ButtonText { get; set; } = &quot;Edit&quot;;
  
      public virtual void OnClick()
      {
          ButtonText = ButtonText == &quot;Edit&quot; ? &quot;Editing...&quot; : &quot;Edit&quot;;
      }
  }
  </code></pre>
  <p>When I click button every thing works as excepted and Button text is changing.
  But when i click on another button i want to change the text of the button.To do this I call the button's onclick method. But when I click the button, the text does not change even though the method is called. Here is my page.</p>
  <pre><code>@page &quot;/test&quot;
  
  &lt;EditButton @ref=&quot;EditButton&quot;&gt;&lt;/EditButton&gt;
  
  &lt;button class=&quot;btn-primary&quot; @onclick=&quot;ChangeButtonText&quot;&gt;Change Button Text&lt;/button&gt;
  
  @code {
  
      EditButton EditButton;
  
      void ChangeButtonText()
      {
          EditButton.OnClick();
      }
  }
  </code></pre>