BaconographyWP8.Common.ReorderListBoxItem.OnApplyTemplate C# (CSharp) Method

OnApplyTemplate() public method

Applies the control template, checks for required template parts, and initializes visual states.
public OnApplyTemplate ( ) : void
return void
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            this.DragHandle = this.GetTemplateChild(ReorderListBoxItem.DragHandlePart) as ContentPresenter;

            if (this.DragHandle == null)
            {
                throw new InvalidOperationException("ReorderListBoxItem must have a DragHandle ContentPresenter part.");
            }

            VisualStateManager.GoToState(this, ReorderListBoxItem.ReorderDisabledState, false);
            VisualStateManager.GoToState(this, ReorderListBoxItem.NotDraggingState, false);
            VisualStateManager.GoToState(this, ReorderListBoxItem.NoDropIndicatorState, false);
        }
    }