The presence of an AddVisualChild method seems to imply that one can add a child visual to an object derived from Visual
. If so, what is the purpose of the ContainerVisual`class?
Most Visual
derived classes allows for a single parent-child relationship in terms of visuals. By putting AddVisualChild within the Visual class, all Visual derived classes that allow for a child or children can use the same methodology and logic to manage their parent relationships.
ContainerVisual
is intended for Visual
implementations that allow for multiple children, via the Children property.
Visual
, on the other hand, provides the plumbing to allow subclasses to expose a single child (Content
), no content, or multiple Children using a uniform API.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With