在VB中覆盖事件

有没有办法在VB中翻译这段代码? 大部分都很简单,但我无法想出一种覆盖事件处理程序的方法。

public class MTObservableCollection : ObservableCollection { public MTObservableCollection() { _DispatcherPriority = DispatcherPriority.DataBind; } public MTObservableCollection(DispatcherPriority dispatcherPriority) { _DispatcherPriority = dispatcherPriority; } private DispatcherPriority _DispatcherPriority; public override event NotifyCollectionChangedEventHandler CollectionChanged; protected override void OnCollectionChanged(NotifyCollectionChangedEventArgs e) { var eh = CollectionChanged; if (eh != null) { Dispatcher dispatcher = (from NotifyCollectionChangedEventHandler nh in eh.GetInvocationList() let dpo = nh.Target as DispatcherObject where dpo != null select dpo.Dispatcher).FirstOrDefault(); if (dispatcher != null && dispatcher.CheckAccess() == false) { dispatcher.Invoke(DispatcherPriority.DataBind, (Action)(() => OnCollectionChanged(e))); } else { foreach (NotifyCollectionChangedEventHandler nh in eh.GetInvocationList()) nh.Invoke(this, e); } } } } 

在C#中覆盖事件甚至是错误的。 C#编程指南说:

不要在基类中声明虚拟事件,并在派生类中重写它们。 C#编译器在Microsoft Visual Studio 2008中无法正确处理这些问题,并且派生事件的订阅者是否实际上将订阅基类事件是不可预测的。

我想知道为什么框架类会破坏这个规则,甚至编译器为什么允许它。

重写编辑:

一个对话,它认为它是一个编译器实现snafu并建议解决方法:

http://social.msdn.microsoft.com/Forums/en/vblanguage/thread/ce30ceed-c260-4d99-b96d-5b7179466be8

这是我的(半)最终答案。