简体   繁体   中英

Send data to another xaml in Windows Phone 8.1 - VB.NET

How can I get a variable in one xaml(when the button is clicked) to appear in another xaml in a textbox. Basically once the button is clicked in Menu.xaml the name variable is displayed in a text box in Basket.xaml. How can I go about doing that?

Button in Menu.xaml

 Private Sub VanButton_Click(sender As Object, e As RoutedEventArgs) Handles VanButton.Click
    Dim Name As String = "Vanilla"
End Sub

Variable Name into Basket.xaml textbox once button is clicked in Menu.xaml

Private Sub IcecreamChosen_TextChanged(sender As Object, e As TextChangedEventArgs) Handles IcecreamChosen.TextChanged

End Sub

The app is developed in VB.NET , Visual Studios 2015. I am new to this and have no idea on how to make it work this way.

You have to give a name to your textbox and the in the button click event handle you can write yourtextboxname.Text = variabile

Anyway I suggest you to start using databinding approach. Xaml is databinding based! :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM