I'm writing a simple calendar control for better understanding of WPF. I have a CalendarHeader control that contains two buttons (next,prevoious) and a dependency property CurrentMonth defined as
public static DependencyProperty CurrentMonthProperty = DependencyProperty.Register
("CurrentMonth", typeof(int), typeof(CalendarHeader), new FrameworkPropertyMetadata(DateTime.Now.Month, FrameworkPropertyMetadataOptions.None, CurrentMonthChangedCallBack));
Another control that need so interact with CalenderHeader is CalendarMonth. To inform CalendarMonth when a month is changed in CalendarHeader, I'm adding an owner dependency property to it as
public static DependencyProperty CurrentMonthProperty = CalendarHeader.CurrentMonthProperty.AddOwner
(typeof(CalendarMonth), new FrameworkPropertyMetadata(DateTime.Now.Month, CurrentMonthChangedCallBack));
When CalendarHeader changes the value of CurrentMonth, I thought it would also trigger the CurrentMonthChangedCallBack in CalendarMonth but it's not doing that. How can I inform CalendarMonth that the value of CurrentMonth in CalendarHeader is changed. Thanks a million