Yes, all of the C# code has to be inside the .cs (Class) file. Where you would handle and execute tasks in your applications.
Even if you write the XAML code for the TextChanged event as
<textbox textchanged="eventhandler" />
.. the code would still call the eventhandler from the code-behind.
MSDN documentation[
^] for TextChanged.
You can group the TextBox by adding them inside a
StackPanel
. That StackPanel would contain all of the TextBox relative to each other, in it.
You can have multiple TextBox controls in your application, like this
<TextBox Name="first" TextChanged="eventhandler" />
<TextBox Name="second" TextChanged="eventhandler" />
.. and they would both have an event handler like this
void TextChanged (object sender, EventArgs e) {
TextBox textBox = sender as TextBox;
string name = textBox.Name;
if(name == "first") {
MessageBox.Show("First textbox value was changed.");
} else {
MessageBox.Show("Second textbox value was changed.");
}
}