private void SetState(IVirtualList list, QueuedBackgroundWorkerState loadingState)
            {
                if (list == List && loadingState == LoadingState)
                {
                    return;
                }

                List         = list;
                LoadingState = loadingState;
                VirtualListLoadingIndicator loadingIndicator = LoadingIndicator;
                bool oldIsVisible = loadingIndicator != null;
                bool newIsVisible = LoadingState != QueuedBackgroundWorkerState.Standby;

                if (oldIsVisible == newIsVisible)
                {
                    if (newIsVisible)
                    {
                        loadingIndicator.SetState(List, LoadingState);
                    }
                }
                else if (newIsVisible)
                {
                    AdornerManager.SetAdorner(_itemsControl, new VirtualListLoadingIndicator(List, LoadingState));
                }
                else
                {
                    AdornerManager.SetAdorner(_itemsControl, null);
                }
            }
            public void Dispose()
            {
                if (LoadingIndicator != null)
                {
                    AdornerManager.SetAdorner(_itemsControl, null);
                }

                if (_itemsControl != null)
                {
                    DependencyPropertyDescriptor dpd = DependencyPropertyDescriptor.FromProperty(ItemsControl.ItemsSourceProperty, typeof(ItemsControl));
                    dpd.RemoveValueChanged(_itemsControl, OnItemsSourceChanged);
                    _itemsControl = null;
                }
                if (_list != null)
                {
                    _list.LoadingStateChanged -= OnLoadingStateChanged;
                    _list = null;
                }
                _loadingState = QueuedBackgroundWorkerState.Standby;
                GC.SuppressFinalize(this);
            }