I have a class structure like so:
Class ReportSection
...
End Class
Class ReportContent
Inhertis ReportSection
...
Public Overridable Function MyFunction() as Boolean
End Class
Class ReportGrouping
Inhertis ReportContent
...
Public Overrides Function MyFunction() as Boolean
End Class
For Context: These classes are used to define dependency properties in a wpf project where ReportGrouping is a Dependency Property of ReportContent. The following is a simplified example of the hierarchy:
<kr:ReportContent>
<kr:ReportContent.Body>
<kr:ReportGrouping>
<kr:ReportGrouping.Body>
</kr:ReportGrouping.Body >
</kr:ReportGrouping >
</kr:ReportContent.Body >
</kr:ReportContent >
The problem is that if I add the ReportGroup to the ReportContent then the Function in the ReportGroup gets called, even when I am calling the function from within the ReportContent Class.
I need help to make sure the the MyFunction gets called from ReportContent when its called from ReportContent, and from ReportGroup when ReportGroup calls for it.
I tried changing the functions to protected instead of public - same problem
如果要强制它调用当前类而不是派生类定义的方法的版本,则需要使用MyClass
关键字,例如:
MyClass.MyFunction()
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.