I am working on a user control named DateMonthControl. It is supposed to show months between a min-date and a max-date - and to enable the user to select a specific month.
That is: Minimum month may be september 2011 and maximum month may be april 2014. The user must then be able to select a month between these two - for instance may 2013.
The xaml for the control looks like this:
<local:DateMonthControl
MinDateMonth="{Binding Source={StaticResource myDataSource}, Path=MinDateMonth}"
MaxDateMonth="{Binding Source={StaticResource myDataSource}, Path=MaxDateMonth}"
SelectedDateMonth="{Binding Source={StaticResource myDataSource}, Path=SelectedDateMonth}" />
My problem is, that I really do not want to calculate anything in my control before MinDateMonth, MaxDateMonth - and possibly SelectedDateMonth has been set by the framework.
(I need to disable the months not allowed in the years allowed. In this example I need to disable january-august 2011 and may-december 2013 - and I don't want to do that on the default values which is DateTime.Min, DateTime.Max and DateTime.Now).
So.. is there some event my user control may hook into, which get called just after all dependency properties has been initiated? - but possibly before the control has been rendered and databinding occurred?).
Thx