Vb.net 适用于windows phone的VB silverlight

Vb.net 适用于windows phone的VB silverlight,vb.net,silverlight,windows-phone-7,Vb.net,Silverlight,Windows Phone 7,我正在用VB为WindowsPhone7.5编写一个应用程序 但是它有一些bug Imports System.IO Imports System.IO.TextReader Imports System.Xml Imports System.Windows.RoutedEventArgs Imports System.Windows.RoutedEvent Imports System.ComponentModel Imports System Imports System.Collectio

我正在用VB为WindowsPhone7.5编写一个应用程序

但是它有一些bug

Imports System.IO
Imports System.IO.TextReader
Imports System.Xml
Imports System.Windows.RoutedEventArgs
Imports System.Windows.RoutedEvent
Imports System.ComponentModel
Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Net
Imports System.Windows
Imports System.Windows.Controls
Imports System.Windows.Documents
Imports System.Windows.Input
Imports System.Windows.Media
Imports System.Windows.Media.Animation
Imports System.Windows.Shapes
Imports Microsoft.Phone.Tasks
Imports System.Xml.Linq 
Imports System.Net.NetworkInformation
Imports Microsoft.VisualBasic.CompilerService

Partial Public Class MainPage
    Inherits PhoneApplicationPage

    Public Sub New()
        InitializeComponent()
    End Sub

    Private Sub MainPage_Loaded(sender As Object, e As System.Windows.RoutedEventArgs)             Handles MyBase.Loaded
        Final.Items.Clear()
        If NetworkInterface.GetIsNetworkAvailable Then
            Dim cl As New WebClient
            AddHandler cl.DownloadStringCompleted, AddressOf cl_DownloadStringCompleted
            cl.DownloadStringAsync(New Uri("http://web.com/xml.xml"))
        Else
            MessageBox.Show("check your internet connection")
        End If
    End Sub


    Private Sub cl_DownloadStringCompleted(sender As Object, e As System.Net.DownloadStringCompletedEventArgs)
        Dim doc = XDocument.Parse(e.Result)
        Dim names = XDocument.Parse(e.Result)
        Dim result_name = names.<Data>.<Entry>
        For Each result In doc.<Data>.<Entry>.<tag>
            Dim item As New ListBoxItem
            item.Content = result.Value
            AddHandler item.Tap, AddressOf ItemTap
            Final.Items.Add(item)
        Next
    End Sub

    Private Sub ItemTap(sender As Object, e As GestureEventArgs)
        Dim lbi As New ListBoxItem
        lbi = sender
        Dim url As New Uri("/" & lbi.Content & ".xaml", UriKind.Relative)
        Me.NavigationService.Navigate(url)
    End Sub

End Class
Imports System.IO
导入System.IO.TextReader
导入System.Xml
导入System.Windows.RoutedEventArgs
导入System.Windows.RouteEvent
导入System.ComponentModel
导入系统
导入System.Collections.Generic
导入系统
导入系统.Net
导入系统.Windows
导入System.Windows.Control
导入System.Windows.Documents文件
导入System.Windows.Input
导入System.Windows.Media
导入System.Windows.Media.Animation
导入System.Windows.Shapes
导入Microsoft.Phone.Tasks
导入System.Xml.Linq
导入System.Net.NetworkInformation
导入Microsoft.VisualBasic.CompilerService
部分公共类主页
继承PhoneApplicationPage
公共分新()
初始化组件()
端接头
加载的私有子主页(发件人作为对象,e作为System.Windows.RoutedEventArgs)处理MyBase.Loaded
Final.Items.Clear()
如果NetworkInterface.GetIsNetwork可用,则
Dim cl作为新的网络客户端
AddHandler cl.DownloadStringCompleted,cl_DownloadStringCompleted的地址
cl.DownloadStringAsync(新Uri(“http://web.com/xml.xml"))
其他的
MessageBox.Show(“检查您的internet连接”)
如果结束
端接头
私有子cl_DownloadStringCompleted(发送方作为对象,e作为System.Net.DownloadStringCompletedEventArgs)
Dim doc=XDocument.Parse(e.Result)
Dim names=XDocument.Parse(e.Result)
Dim result_name=名称。。
对于文档中的每个结果。。。
将项目设置为新的ListBoxItem
item.Content=result.Value
AddHandler item.Tap,AddressOf ItemTap
最终。项目。添加(项目)
下一个
端接头
私有子项点击(发送者作为对象,e作为GestureEventArgs)
将lbi调整为新的ListBoxItem
lbi=发送方
作为新Uri的Dim url(“/”&lbi.Content&“.xaml”,UriKind.Relative)
Me.NavigationService.Navigate(url)
端接头
末级
它在
dimURL中发现一个bug,作为新的Uri(“/”&lbi.Content&“.xaml”,UriKind.Relative)

报告上说:

请求的操作不可用,因为运行库 功能 'Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject' 没有定义

注: 当我将ItemTap更改为以下内容时:
Private Sub-ItemTap(ByRef sender作为对象,e作为GestureEventArgs)

此错误消失并显示另一个错误:

方法的私有子项TAP(ByRef发送方作为对象,e作为 System.Windows.Input.GestureEventArgs)“”没有签名 与委托的委托子事件处理程序(的)兼容 System.Windows.Input.GestureEventArgs)(发件人作为对象,e作为 System.Windows.Input.GestureEventArgs')

在第行:“AddHandler item.Tap,AddressOf ItemTap”

你知道我为什么有这个吗??
谢谢大家!

您试图将两个字符串和一个对象组合起来,但它无法做到这一点

我强烈怀疑
lbi.Content
(在出错的行中)是一个文本块,因此您的代码会说“将字符串、文本块和字符串连接在一起”。
我怀疑您想要文本块中显示的文本,因此只需相应地强制转换它:

"/" & DirectCast(lbi.Content, TextBlock).Text & ".xaml"