title: WPF Blazor hybrid - how to use values from .razor in code-behind?
body: <p>I have a <code>MainWindow.xaml</code> with a <code>BlazorWebView</code>. I've added two forms in my <code>Index.razor</code>:</p>
  <pre><code>&lt;form&gt;
          &lt;input type=&quot;text&quot; id=&quot;id_item1&quot; name=&quot;item1&quot; @bind=&quot;@inputValue1&quot; @oninput=&quot;OnInputEvent1&quot; &gt;&lt;br&gt;
  &lt;/form&gt;
  </code></pre>
  <pre><code>&lt;form action=&quot;#&quot;&gt;
          &lt;select name=&quot;categories&quot; id=&quot;cat1&quot; size=&quot;1&quot;&gt;
              &lt;option value=&quot;&quot; selected&gt;ThisCategory&lt;/option&gt;
  &lt;/form&gt;
  </code></pre>
  <p>This second form is a drop down menu.</p>
  <p>I have been trying to bind it like this:</p>
  <pre><code>@code {
  
      private string inputValue1 = &quot;&quot;;
      private void OnInputEvent1(ChangeEventArgs changeEvent) {
  
          inputValue1 = (string)changeEvent.Value;
      }
  </code></pre>
  <p>It's basically a shopping list. Write in an item in form 1, choose its category in form2.</p>
  <p>I then want to grab the item and its correlating category and somehow get it to my SQL database. I don't care if I use it from the <code>index.razor.cs</code> or from the <code>MainWindow</code> code-behind.</p>
  <p>How can I go about doing that? (This project is not MVVM)</p>