public static void OnMaxDateTimeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
TimelineTray t;
t = d as TimelineTray;
if (t != null && e.NewValue != e.OldValue)
{
if ((DateTime) e.NewValue < t.MinDateTime)
{
throw new ArgumentOutOfRangeException("MaxDateTime cannot be less then MinDateTime");
}
else if (t.CurrentDateTime >= (DateTime) e.NewValue)
{
t.SetValue(CurrentDateTimeProperty, e.NewValue);
}
foreach (TimelineBand b in t.m_bands)
{
if (b.Calculator != null && b.Calculator.Calendar != null)
{
b.Calculator.Calendar.MaxDateTime = ((DateTime) e.NewValue);
}
}
}
}