ContextHolder ContextType shows classes that are not derived from Context

Issue #108 closed
Keith Leung created an issue

Hello,

I’ve run into an issue with ContextType dropdown showing classes that do not derive from Context.

I’m not sure if this is intended, but it is causing issues with binding since it leads to binding to properties from other context class and I believe the issue is in TypeInfoUtils.FindTypesWithBase.

Currently, it is looking for types that are baseType.IsAssignableFrom

I changed it to type => type.IsSubclassOf(baseType) || type == baseType locally, and now my ContextType drop-down only shows classes that are derived from Context.

Comments (4)

  1. Christian Oeing repo owner

    @Keith Leung Thanks again for your report. I will hopefully soon have time to check if this was intended. If not, your suggestion sounds like a good solution.

  2. Christian Oeing repo owner

    @Keith Leung I had a look, but I could not find a case where a wrong type showed up. Could you send me some examples of types that were wrongly shown in the drop down?

  3. Log in to comment