I have two User Controls, and a Calendar in each. I need to be able to bind the selected date range in one to the selected date range in the other. Is there an easy way to do this?
Share
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 both of them share the same ViewModel then you can just bind to the same property.
If they have separate ViewModels then you’re approaching the problem in the wrong way. A UserControl shouldn’t bind to things outside of its boundaries and binding to a sibling controls child is even worse. This will make your UI elements tightly coupled with each other and you wouldn’t know why one broke because you made change in the other one.
Consider sharing the same ViewModel instead.