BaconographyWP8.Common.ReorderListBox.ClearContainerForItemOverride C# (CSharp) Method

ClearContainerForItemOverride() protected method

Called when an item container (ReorderListBoxItem) is being removed from the list panel. This may be because the item was removed from the list or because the item is now outside the virtualization region (because ListBox uses a VirtualizingStackPanel as its items panel).
protected ClearContainerForItemOverride ( DependencyObject element, object item ) : void
element System.Windows.DependencyObject
item object
return void
        protected override void ClearContainerForItemOverride(DependencyObject element, object item)
        {
            base.ClearContainerForItemOverride(element, item);

            ReorderListBoxItem itemContainer = (ReorderListBoxItem)element;
            if (itemContainer == this.dragItemContainer)
            {
                this.dragItemContainer.Visibility = Visibility.Visible;
                this.dragItemContainer = null;
            }
        }