I have a custom control inheriting from Calendar from this project : https://www.codeproject.com/Articles/104081/Extending-the-WPF-Calendar-Control. I would like to have a DatePicker that use this calendar instead of the default one.
With the help of this topic : How to get a Calendar in DatePicker in WPF I can get the calendar of my DatePicker, the next step is to make the DatePicker open the custom calendar.
Here is my code in the MainWindow :
// Find the Popup in template
Popup MyPopup = FindChild<Popup>(MyDatePicker, "PART_Popup");
//Custom calendar
FsControls.FsCalendar CalendarForDatePicker = new FsControls.FsCalendar();
//Use custom calendar in the DatePicker
MyPopup.Child = CalendarForDatePicker;
It works and open the custom calendar when I click in the DatePicker, but the events are not linked and raised when I select a date. I don't know the right way to "connect" the events from my custom calendar to the DatePicker.
Am I missing some steps ?