【问题标题】:Send data to another xaml in Windows Phone 8.1 - VB.NET在 Windows Phone 8.1 中将数据发送到另一个 xaml - VB.NET
【发布时间】:2016-04-07 22:14:38
【问题描述】:

如何让一个 xaml 中的变量(单击按钮时)出现在文本框中的另一个 xaml 中。 基本上,一旦在 Menu.xaml 中单击按钮,名称变量就会显示在 Basket.xaml 的文本框中。我该怎么做呢?

Menu.xaml 中的按钮

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

在 Menu.xaml 中单击按钮后,变量名称进入 Basket.xaml 文本框

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

End Sub

该应用程序是在 VB.NET,Visual Studios 2015 中开发的。我是新手,不知道如何使它以这种方式工作。

【问题讨论】:

    标签: vb.net xaml windows-phone-8 visual-studio-2015 windows-phone-8.1


    【解决方案1】:

    您必须为您的文本框命名,并且在按钮单击事件句柄中您可以编写 yourtextboxname.Text = variabile

    无论如何,我建议您开始使用数据绑定方法。 Xaml 是基于数据绑定的! :)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-05-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-08-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多