Is the type System.Windows.PresentationFrameworkCollection<T> not intended for inheritance? I was trying to make a custom <Type>AnimationsFromKeyFrames object, but I can’t create the Collection type for the KeyFrames property because Visual Studio is apparently making up some errors.
Visual Studio reports the following abstract members are not implemented, even though they don’t exist on any of the inherited objects:
‘MyKeyFrameCollection’ does not implement inherited abstract member ‘System.Windows.PresentationFrameworkCollection<MyKeyFrame>.SetItemImplSkipMethodPack(int, MyKeyFrame)’
‘MyKeyFrameCollection’ does not implement inherited abstract member ‘System.Windows.PresentationFrameworkCollection<MyKeyFrame>.GetItemImplSkipMethodPack(int)’
‘MyKeyFrameCollection’ does not implement inherited abstract member ‘System.Windows.PresentationFrameworkCollection<MyKeyFrame>.RemoveInternal(MyKeyFrame)’
‘MyKeyFrameCollection’ does not implement inherited abstract member ‘System.Windows.PresentationFrameworkCollection<MyKeyFrame>.InsertInternal(int, MyKeyFrame)’
‘MyKeyFrameCollection’ does not implement inherited abstract member ‘System.Windows.PresentationFrameworkCollection<MyKeyFrame>.IndexOfInternal(MyKeyFrame)’
‘MyKeyFrameCollection’ does not implement inherited abstract member ‘System.Windows.PresentationFrameworkCollection<MyKeyFrame>.ContainsInternal(MyKeyFrame)’
‘MyKeyFrameCollection’ does not implement inherited abstract member ‘System.Windows.PresentationFrameworkCollection<MyKeyFrame>.AddInternal(MyKeyFrame)’
How do I go about either implementing these methods from bizarro world, or else tell Visual Studio to stop making up gripes and just compile the project?
I’ve tried explicitly defining these methods using the following which didn’t (rightly so, as per previous non-existence remark) work:
void System.Windows.PresentationFrameworkCollection<MyKeyFrame>.AddInternal(MyKeyFrame keyFrame)
void System.Collections.Generic.IList<MyKeyFrame>.AddInternal(MyKeyFrame keyFrame)
void System.Collections.Generic.ICollection<MyKeyFrame>.AddInternal(MyKeyFrame keyFrame)
void System.Collections.IList.AddInternal(MyKeyFrame keyFrame)
void System.Collections.ICollection.AddInternal(MyKeyFrame keyFrame)
At wit’s end, and thinking that MS doesn’t want the community making KeyFrameCollections?
EDIT: I’ve tried, and my only override options are Equals, GetHashCode, and ToString. Is it possible these abstract members are protected internal so that the existing framework classes can inherit from them, but custom classes cannot?
PresentationFrameworkCollectionis a public abstract class but the members you are referring to areinternal abstractwhich means you can not override them.