将数据从一个页面传递到另一个页面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
祝你好运