当我点击LongListSelector中的特定项目时,是否有人知道如何打开Coding4Fun用户控件。我想要一些项目将我带到不同的页面,但也需要一些项目来打开用户控件。
Partial Public Class Station_Chooser
Inherits PhoneApplicationPage
Public Sub New()
InitializeComponent()
Dim source As New List(Of AStations)()
source.Add(New AStations("Aldgate", "Fare zone 1"))
source.Add(New AStations("Aldgate East", "Fare zone 1"))
source.Add(New AStations("Angel", "Fare zone 1"))
source.Add(New AStations("Baker Street", "Fare zone 1"))
source.Add(New AStations("Bank", "Fare zone 1"))
source.Add(New AStations("Barbican", "Fare zone 1"))
source.Add(New AStations("Bayswater", "Fare zone 1"))
source.Add(New AStations("Blackfriars", "Fare zone 1"))
source.Add(New AStations("Bond Street", "Fare zone 1"))
source.Add(New AStations("Borough", "Fare zone 1"))
Dim DataSource As List(Of AlphaKeyGroup(Of AStations)) = AlphaKeyGroup(Of AStations).CreateGroups(source, System.Threading.Thread.CurrentThread.CurrentUICulture, Function(s As AStations)
Return s.Station
End Function, True)
AllStations.ItemsSource = DataSource
End Sub
Public Class AStations
Public Property Station() As String
Get
Return m_Station
End Get
Set(value As String)
m_Station = value
End Set
End Property
Private m_Station As String
Public Property FareZone() As String
Get
Return m_FareZone
End Get
Set(value As String)
m_FareZone = value
End Set
End Property
Private m_FareZone As String
Public Property Link() As String
Get
Return m_Link
End Get
Set(value As String)
m_Link = value
End Set
End Property
Private m_Link As String
Public Sub New(station As String, farezone As String, link As String)
Me.Station = station
Me.FareZone = farezone
Me.Link = link
End Sub
End Class
End Class
答案 0 :(得分:0)
当然这是一个“快速修复”。我假设AllStations是你的LongListSelector。所以在XAML中找到它的代码 或强>
转到proprities窗口,然后单击事件处理程序(它有一个闪电图标)。向下滚动到SelectionChanged,然后双击文本框。它将在代码中创建一个事件处理程序。它会看起来像这样。
private void AllStations_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
//your logic
}
}
现在你可以处理这个事件了。因此,当您在模拟器或设备上进行测试时,您只需点击该项目即可。