title: Trying to get textbox input in C# wpf (2nd attempt)
body: <p>I can't figure out how to do this correctly.</p>
  
  <p>The "solution" here: "<a href="https://stackoverflow.com/questions/32563111/get-user-input-from-textbox-in-wpf-application">Get user input from textbox in WPF application</a>" doesn't work, and it's about all I can find.</p>
  
  <p>If I'm missing something simple, or if I'm simply going about this in entirely the wrong way please let me know.</p>
  
  <p>Thanks in advance</p>
  
  <pre><code>&lt;Window x:Class="WpfApplication2.MainWindow"
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
          xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
          xmlns:local="clr-namespace:WpfApplication2"
          mc:Ignorable="d"
          Title="MainWindow" Height="350" Width="525"&gt;
      &lt;Grid Background="{DynamicResource {x:Static SystemColors.ActiveCaptionBrushKey}}"&gt;
          &lt;TextBox x:Name="textBox" TextWrapping="Wrap" Text="TextBox" Margin="114,48,125,158" TextChanged="textBox_TextChanged"/&gt;
          &lt;Button x:Name="button" Content="Button" Margin="188,0,212,86" RenderTransformOrigin="0.5,0.5 Height="38" VerticalAlignment="Bottom" Click="button_Click""&gt;
          &lt;/Button&gt; &gt;
  
      &lt;/Grid&gt;
  &lt;/Window&gt;
  </code></pre>
  
  <hr>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using System.Windows;
  using System.Windows.Controls;
  using System.Windows.Data;
  using System.Windows.Documents;
  using System.Windows.Input;
  using System.Windows.Media;
  using System.Windows.Media.Imaging;
  using System.Windows.Navigation;
  using System.Windows.Shapes;
  
  namespace WpfApplication2
  {
       public partial class MainWindow : Window
      {
          public MainWindow()
          {
              InitializeComponent();
          }
  
          private void textBox_TextChanged(object sender, TextChangedEventArgs e)
          {
  
          }
  
          private void button_Click(object sender, RoutedEventArgs e)
          {
              /// trying to get textbox input via button press
              /// this doesn't work:
              string input = textBox_TextChanged.Text;
  
              ///neither does var input = textBox_TextChanged.Text
              /// or anything else in the textBox_Textchanged position
              /// I'm pulling my hair out...
          }
  
      }
  }
  </code></pre>