How to remove a wpf element on a canvas by it's tag name? -
How can you remove a wpf element with some type of name? So like sth:
// times some sort of usercontrol times is b = new bar (); Btig = "some iid"; TheCanvas.Children.Add (b); // Later can be removed without reference to the sheeting. Children In addition to the course, RemoveElementWithTag is not an existing method ...
Just use some LINQ:
var child = (In sheeting where children have" some id ".Equals (c.Tag) Select c). first (); TheCanvas.Children.Remove (child); He said, I am very skeptical that whatever you want to achieve, there is a cleaner, better way to achieve it.
Comments
Post a Comment