I have several XAML TextBox es, each of which controls the corresponding value in the array when the value in the TextBox changes using the C# method, which dynamically checks which TextBox called the method.
<TextBox x:Name="_0_0" TextChanged="_x_y_TextChanged"/> <TextBox x:Name="_0_1" TextChanged="_x_y_TextChanged"/> <TextBox x:Name="_0_2" TextChanged="_x_y_TextChanged"/> // And so on.....
each of which controls the corresponding value in the array when the value in the TextBox changed using the C # method, which dynamically checks which TextBox called the method.
private void _x_y_TextChanged(object sender, TextChangedEventArgs e) { TextBox current = (TextBox)sender; string currentname = current.Name; string rowstring = currentname.Substring(1, 1); string columnstring = currentname.Substring(3, 1); int row = Convert.ToInt32(rowstring); int column = Convert.ToInt32(columnstring);
Thus, this information can be used to dynamically store information from a TextBox in the corresponding index of the array - or what you want to do with it ...
My question, however, is this:
How to create a method that uses the location of indexes in my array, call the corresponding TextBox and update its text?
source share