简体   繁体   English

将数据发送到Windows Phone 8.1中的另一个xaml-VB.NET

[英]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. 我如何在一个xaml中获得一个变量(单击按钮时)以在文本框中的另一个xaml中出现。 Basically once the button is clicked in Menu.xaml the name variable is displayed in a text box in Basket.xaml. 基本上,一旦在Menu.xaml中单击按钮,名称变量就会显示在Basket.xaml的文本框中。 How can I go about doing that? 我该怎么做呢?

Button in Menu.xaml 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 单击Menu.xaml中的按钮后,将变量名称输入到Basket.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. 该应用程序是在VB.NET,Visual Studios 2015中开发的。对此我是陌生的,不知道如何使它以这种方式工作。

You have to give a name to your textbox and the in the button click event handle you can write yourtextboxname.Text = variabile 您必须给文本框起一个名字,然后在按钮单击事件句柄中编写文本框名。Text = variabile

Anyway I suggest you to start using databinding approach. 无论如何,我建议您开始使用数据绑定方法。 Xaml is databinding based! Xaml是基于数据绑定的! :) :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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