Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
将数据从一个页面传递到另一个页面WPF VB.Net_Wpf_Vb.net - Fatal编程技术网

将数据从一个页面传递到另一个页面WPF VB.Net

将数据从一个页面传递到另一个页面WPF VB.Net,wpf,vb.net,Wpf,Vb.net,我打开了两个WPF页面,我想将第2页的“textbox3.text”发送到第1页的“textbox1.text” 在vb中,这很简单: page1.textbox1.text = texbox3.text 但是我不知道如何在WPF中实现这一点,我想您可以在Page1中创建一个属性,该属性包含文本框中的值 Public ReadOnly Property TextBox1Value() As String Get Return theFirstTextBox.Text

我打开了两个
WPF
页面,我想将第2页的“textbox3.text”发送到第1页的“textbox1.text”

在vb中,这很简单:

page1.textbox1.text = texbox3.text

但是我不知道如何在WPF中实现这一点,我想您可以在Page1中创建一个属性,该属性包含文本框中的值

Public ReadOnly Property TextBox1Value() As String
    Get
        Return theFirstTextBox.Text
    End Get
End Property
获取该值并将其传递给构造函数中的Page2,例如

Public Sub New(ByVal value As String)

    ' This call is required by the Windows Form Designer.
    InitializeComponent()

    ' Add any initialization after the InitializeComponent() call.
    theSecondTextBox.Text = value
End Sub

Private Sub CreatePage2Method()
    Dim page As Page2 = New Page2("BlaBlaBla")
    NavigationService.Navigate(page)
End Sub
祝你好运