We have implemented the CalendarEdit control in this way, but the MinDate/MaxDate are not respected when the control is shown: Dates beyond MinDate/MaxDate are shown and selectable:
<sf:CalendarEdit x:Name="PopupKernFormStatusCalendar"
Date="{Binding Mode=OneWay, Path=DataContext.AssociatedObjectDataContext.CalendarMaxDate, RelativeSource={RelativeSource AncestorType={x:Type Popup}}}"
MinDate="{Binding Mode=OneWay, Path=DataContext.AssociatedObjectDataContext.CalendarMinDate, RelativeSource={RelativeSource AncestorType={x:Type Popup}}}"
MaxDate="{Binding Mode=OneWay, Path=DataContext.AssociatedObjectDataContext.CalendarMaxDate, RelativeSource={RelativeSource AncestorType={x:Type Popup}}}"
MinMaxHidden="True" IsShowWeekNumbers="True" ScrollToDateEnabled="True" VisualMode="Days" Margin="5 0 5 0"/>
The MinDate/MaxDate properties are read from the ViewModel correctly when the control shows, but all dates are shown and selectable:
/// <summary>
/// Min/Max dates for popup calendar
/// </summary>
public DateTime CalendarMinDate
{
get => DateTime.Today.AddMonths(-3);
}
public DateTime CalendarMaxDate
{
get => DateTime.Today;
}
What are we having here that the MinDate/MaxDate properties are not respected? The culture used is "de-DE".
Thanks for your support.
Hello,
attached is the sample application that replicates the issue we are having. From preparing it we learned the following:
Thanks for the reply, glad to be helpful in improving the control. Will provide feedback when the update is available.
Hello Sudharsan,
thanks for the efforts, we can confirm that with the update 19.4.0.40 or above the issue can now be closed. The min/max dynamically set behave now as intended.
Thank you.