I have a Page called Page1
.
I have another Page called Page2
with a TextBox called TextBox1
.
I want to manipulate the Text of TextBox1
using Page1
's code.
I have made TextBox1
public using the x:FieldModifier="public"
code in XAML.
I have then tried to use Page2.TextBox1.Text = x
, with no success.
How do I do this?
I did not provide any more code, but please tell me if this is not sufficient.
Answer is in the comments. This is posted in case anyone else comes across this
Page2 is a class, you need to make a variable for that class. In Page1, when Page2 is initialized, store it in a variable, then you can update Page2's textbox with the variable.
Page2 page2 = new Page2();
page2.TextBox1.Text = "my new text";
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With