我有以下代码:
AddHandler aX.Completed, AddressOf AnimationCompleted
...
Private Sub AnimationCompleted(sender As Object, e As EventArgs)
Dim ac As AnimationClock = sender
Dim aX As DoubleAnimationUsingPath = ac.Timeline
RemoveHandler aX.Completed, AddressOf AnimationCompleted
End Sub
抛出:
类型' System.Windows.Media.Animation.DoubleAnimationUsingPath'的指定值必须将IsFrozen设置为false才能修改。
如果对象被冻结,如何删除事件处理程序?我担心的是,如果没有删除事件处理程序,动画对象将无法正确地进行垃圾回收。