我想从form1上的textbox1获取输入并将其设置在form2的textblock1上,但文本不会显示
表格1代码:
private void Button_Click_3(object sender, RoutedEventArgs e)
{
var file = await ApplicationData.Current.LocalFolder.GetFileAsync(textbox1.Text + ".txt");
var line = await FileIO.ReadLinesAsync(file);
if (textbox1.Text == line[0] && tb2.Password == line[1])
{
textbox1.Text = line[0];
Frame.Navigate(typeof(form2));
}
}
public string MyValue
{
get { return textbox1.Text; }
}
form2上的代码
var logged = new MainPage();
textblock1.Text = logged.MyValue;
有什么帮助吗?感谢:D