I have a user control that contains a stackpanel.
I’m trying to find a way to bind the children of the stackpanel to aproperty so that I can access them from another control
Anyone has any clue how to do that?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you are using DataBinding, then enable a binding override your stackpanel with an itemsControl. Then you can work with the collection property named ItemsProperty
If you are in the codebehind, you don’t need to override the ItemsControl, just call stackpanel1.Children.Add(item); (if x:Name=”stackpanel1″ in XAML).
Then stackPanel1.Children should have elements.