Beispiel #1
0
        public void ScrollbarScrollHandler(object sender, ScrollEventArgs e)
        {
            if (Interlocked.Exchange(ref _inScrollHandler, 1) != 0)
            {
                return;
            }

            if (_control != null)
            {
                switch (e.ScrollOrientation)
                {
                case ScrollOrientation.HorizontalScroll:
                    _control.SetScrollValue(ScrollOrientation.HorizontalScroll, e.NewValue);
                    break;

                case ScrollOrientation.VerticalScroll:
                    _control.SetScrollValue(ScrollOrientation.VerticalScroll, e.NewValue);
                    break;
                }
            }

            Interlocked.Exchange(ref _inScrollHandler, 0);
        }