Krempel.WP7.Core.Controls.ReorderListBoxItem.OnDropIndicatorHeightChanged C# (CSharp) Method

OnDropIndicatorHeightChanged() protected method

Updates the drop-indicator height value for visual state and transition animations.
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.
protected OnDropIndicatorHeightChanged ( System.Windows.DependencyPropertyChangedEventArgs e ) : void
e System.Windows.DependencyPropertyChangedEventArgs
return void
        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);
                    }
                }
            }
        }