In order to support nested control properties on custom windows (such as the StatusBar on Actipro's RibbonWindow), I found myself modifying the OnGetNamedElements function by adding a check similar to the HeaderedContentControl (in fact, my check is
right after that). However, I find that all I am trying to do is enhance the list of possible visible controls to be put into the queue. The rest of the logic in the function is fine, but sufficiently complex that I do not want to maintain my own copy of the
whole function. To that end, I modified my current private copy of the method to call a new method 'CheckForNamedElementsOnContentControl(contentControl, queue);' right after the check for HeaderedContentControl. This got me thinking that this might be a point
of extensibility that should be in the CM core code. This could be another function on BindingScope, such as BindingScope.CheckForNamedElementsOnContentControl that defaults to a NO-OP. The performance impact should be negligible,
and it seems simple and small enough to fit the CM mantra of minimalism.
In fact, the default HeaderedContentControl check should be moved into the base version, and then the function would get simpler :).
Lastly, a similar thing should probably be done for code doing the custom HeaderedItemsControl, but there seems to be less need for that.