我有mainpage.xaml,因为我创建了事件
Public Event ValueChanged()
我在下拉列表中将selectedindexchanged事件提升为
Private Sub ComboBox1_SelectionChanged(ByVal sender As System.Object, ByVal e As System.Windows.Controls.SelectionChangedEventArgs) Handles ComboBox1.SelectionChanged
RaiseEvent ValueChanged()
End Sub
我需要在test.xaml页面中访问此事件,我需要如何调用该事件..
答案 0 :(得分:0)
使用构造函数
将MainPage实例的引用传递给TestPagePublic Sub New(mainPage As MainPage){
// store reference and register event;
}
或向TestPage添加属性以设置对MainPage的引用
Public Property MainPage() As MainPage
Get
Return m_MainPage
End Get
Set
m_MainPage = Value
// register event of MainPage
End Set
End Property
Private m_MainPage As MainPage