How can you programmatically find Label children by their Content inside a Canvas and delete them? They are created dynamically and needlessly removed by their Content
In WPF?Remove Label?Are you seriously?! - EvgeniyZ
one
myCanvas.Children.OfType<Label>().Where(l=>l.Content is MyContent).ToArray() ? - tym32167
one
@Vipz Eugene this question hints that you somehow misunderstand the concept of WPF and you clearly need to close the gaps in the knowledge of the concept.He hints that the question itself shows a lack of understanding of how to work with WPF correctly in principle .... And he ... is right ... You went the wrong direction somewhere and you would have to start learning WPF from scratch to understand why you went the wrong way and where exactly :) But Tym just made a decision by ignoring the wrong understanding of the concepts.But, I advise you to follow the advice of Eugene ... And start to learn how to work with WPF correctly ... - Andrew
one
@Andrew, but from the commentary of Tim, the author of the question is useful, unlike yours and Eugene.He is not interested in concepts, but in a specific problem. - ixScipm
one
@ixSci Here you will come to the doctor with a bad tooth and tell him "Pull out, he already tortured me."The doctor will take, and he will throw up, because you asked so, but if there was a normal doctor, he would say "This tooth can be saved" and would deal with it.So here, the solutions of one problem are a lot and not all of them are good.WPF is primarily binding and working with them, and creating controls through code is a mockery of yourself and WPF in general.So maybe a person just does not know how to work correctly?And maybe then it should be sent in the right direction?How to give him what he wants ... - EvgeniyZ
myCanvas.Children.OfType<Label>().Where(l=>l.Content is MyContent).ToArray()? - tym32167