/// <summary>
/// Updates the drop-indicator height value for visual state and transition animations.
/// </summary>
/// <remarks>
/// This is a workaround for the inability of visual states and transitions to do template binding
/// in Silverlight 3. In SL4, they could bind directly to the DropIndicatorHeight property instead.
/// </remarks>
protected void OnDropIndicatorHeightChanged(DependencyPropertyChangedEventArgs e)
{
Panel rootPanel = (Panel)VisualTreeHelper.GetChild(this, 0);
VisualStateGroup vsg = ReorderListBoxItem.GetVisualStateGroup(
rootPanel, ReorderListBoxItem.DropIndicatorStateGroup);
if (vsg != null)
{
foreach (VisualState vs in vsg.States)
{
foreach (Timeline animation in vs.Storyboard.Children)
{
this.UpdateDropIndicatorAnimationHeight((double)e.NewValue, animation);
}
}
foreach (VisualTransition vt in vsg.Transitions)
{
foreach (Timeline animation in vt.Storyboard.Children)
{
this.UpdateDropIndicatorAnimationHeight((double)e.NewValue, animation);
}
}
}
}