Пример #1
0
        public void RangeSelectorContainer_Unloaded(object sender, RoutedEventArgs e)
        {
            DebugTraceLog.WriteLine("RangeSelectorContainer_Unloaded");
            var adornerLayer = AdornerLayer.GetAdornerLayer(this);

            if (adornerLayer != null && adorner != null)
            {
                if (adorner.AdornerContol != null)
                {
                    adorner.AdornerContol.DataContext = null;
                }
                adornerLayer.Remove(adorner);
            }
            adorner = null;
        }
Пример #2
0
        private void RangeSelectorContainer_Loaded(object sender, RoutedEventArgs e)
        {
            DebugTraceLog.WriteLine("RangeSelectorContainer_Loaded");
            var adornerLayer = AdornerLayer.GetAdornerLayer(this);

            if (adornerLayer != null)
            {
                if (adorner == null)
                {
                    adorner = new RangeSelectorAdorner(this);
                    adornerLayer.Add(adorner);
                }
                adorner.AdornerContol.DataContext = this;
            }
        }