我有两个打开的WPF
页面,我想将Page2中的"textbox3.text"发送到Page1中的"textbox1.text"
在VB中很容易:
page1.textbox1.text = texbox3.text
但我不知道如何在WPF中实现这一点。
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
祝你好运!