Silverlight – Element is already the child of another element
Mike Talbot of Alterian has a clever way of taking most of the guesswork figuring out which piece of XAML is misbehaving, by progressively stripping out child nodes until the error is gone.
In his own words:
When the file has a problem it starts to prune out nodes in the XAML one XML node at a time (I mean it puts back nodes that didn’t solve the problem and tries the next in sequence). It does this starting with the nodes that have no children, then the ones with 1, 2 and so on, until it has to remove the entire body – hopefully the error is found long before this. Using this technique the algorithm tries to give you the most tightly isolated area of the Xaml to focus on.
When it identifies a node, it checks whether removing any attribute helps and returns this in addition to the offending XAML if it resolves the issue.
Link: XAML element is already the child of another element error over at his post.
About this entry
You’re currently reading “ Silverlight – Element is already the child of another element ,” an entry on Chui's Counterpoint
- Published:
- 8.31.10 / 8am
- Category:
- .Net
Comments are closed
Comments are currently closed on this entry.