public static void OnCurrentDateTimeChanged(
DependencyObject d,
DependencyPropertyChangedEventArgs e
)
{
TimelineTray t;
t = d as TimelineTray;
if (t != null && e.NewValue != e.OldValue)
{
if ((DateTime) e.NewValue < t.MinDateTime)
{
t.SetValue(CurrentDateTimeProperty, t.MinDateTime);
}
else if ((DateTime) e.NewValue > t.MaxDateTime)
{
t.SetValue(CurrentDateTimeProperty, t.MaxDateTime);
}
else
{
t.m_currentDateTime = (DateTime) e.NewValue;
if (t.m_mainBand != null)
{
t.m_mainBand.CurrentDateTime = t.m_currentDateTime;
t.m_currentDateTime = t.m_mainBand.CurrentDateTime;
}
}
}
}