开发者

Bind WPF Calendars to Each Other Across Controls

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?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜