Beispiel #1
0
 /// <summary>
 /// Find ScrollViewer from cell and subscribe to it scroll changed event.
 /// </summary>
 /// <param name="cell">Cell.</param>
 private void _SubscribeOnScroller(Cell cell)
 {
     _scrollViewer = XceedVisualTreeHelper.FindScrollViewer(cell);
     if (_scrollViewer != null)
     {
         _scrollViewer.ScrollChanged += new System.Windows.Controls.
                                        ScrollChangedEventHandler(_ScrollViewerScrollChanged);
     }
 }
        /// <summary>
        /// Finds TableViewScrollViewer in visual tree and adds handler to it's "ScrollChanged" event.
        /// Also adds handler to "Unloaded" event of cell editor to remove handlers when it will be unloaded.
        /// </summary>
        private void _SubscribeEvents()
        {
            Debug.Assert(_cellEditor != null);
            Debug.Assert(_popup != null);

            TableViewScrollViewer scrollViewer = XceedVisualTreeHelper.FindScrollViewer(_cellEditor);

            if (scrollViewer != null)
            {
                _scrollViewer = scrollViewer;
                _scrollViewer.ScrollChanged += new ScrollChangedEventHandler(_ScrollViewerScrollChanged);
            }
            else
            {
                // Do nothing, because scroll viewer wasn't found.
            }
        }