Imports System
Imports System.Xml
Imports System.Xml.Schema
Module Module1
WithEvents root As XElement = content
Sub Main()
root.Add(child)
End Sub
Private Sub root_Changing( _
ByVal sender As Object, _
ByVal e As XObjectChangeEventArgs) _
Handles root.Changing
Dim xSender As XElement = DirectCast(sender, XElement)
Console.WriteLine("Changing event raised")
Console.WriteLine(" Sender: {0}", xSender.Name)
Console.WriteLine(" ObjectChange: {0}", e.ObjectChange)
End Sub
Private Sub root_Changed( _
ByVal sender As Object, _
ByVal e As XObjectChangeEventArgs) _
Handles root.Changed
Dim xSender As XElement = DirectCast(sender, XElement)
Console.WriteLine("Changed event raised")
Console.WriteLine(" Sender: {0}", xSender.Name)
Console.WriteLine(" ObjectChange: {0}", e.ObjectChange)
End Sub
End Module