Exemplo n.º 1
0
        /// <summary>
        /// Remove the adorner from the adorner layer and let it be garbage collected.
        /// </summary>
        private void RemoveAdorner()
        {
            //
            // Stop the timer that might be about to fade out the adorner.
            //
            _closeAdornerTimer.Stop();

            if (_adornerLayer != null && _adorner != null)
            {
                _adornerLayer.Remove(_adorner);
                _adorner.DisconnectChild();
            }

            _adorner      = null;
            _adornerLayer = null;

            //
            // Ensure that the state of the adorned control reflects that
            // the the adorner is no longer.
            //
            IsAdornerVisible  = false;
            _adornerShowState = AdornerShowState.Hidden;
        }