Panel.Children vs Panel.InternalChildren -- What's the difference?

  1. You would override MeasureOverride and ArrangeOverride, that must be a mistake in the documentation, or intended for internal Microsoft employees. The MeasureCore and ArrangeCore are sealed by FrameworkElement, so you can't override them.

  2. The Children property is public and simply calls InternalChildren, which is protected. So either is probably safe, since Children would get inlined.

MSDN says otherwise ( http://msdn.microsoft.com/en-us/library/ms754152.aspx) but the documentation is wrong. (use reflector to see that the implementation of Children simply calls InternalChildren)



EDIT: As CodeNaked corrected - MSDN docs are in fact incorrect. InternalChildren and Children are the same.

Using reflector, you can see the implementation of Children which is public UIElementCollection Children { get { return this.InternalChildren; } }. So unless there is some voodoo going on, they are the same.


Children are just children that were added regularly, whereas InternalChildren includes children that were added through data binding (when the panel is the ItemsPanelTemplate)

"Children represents the child collection of elements that the Panel is comprised of. InternalChildren represents the content of the Children collection plus those members generated by data binding. Both consist of a UIElementCollection of child elements hosted within the parent Panel."

see http://msdn.microsoft.com/en-us/library/ms754152.aspx