Esempio n. 1
0
        internal int GetCellIndexAtLocation(Point loc)
        {
            var uie = InputHitTest(loc) as FrameworkElement;

            if (uie == null)
            {
                return(-1);
            }

            var rowPresenter = TableViewUtils.GetAncestorByType <TableViewCellsPresenter>(uie);

            if (rowPresenter == null)
            {
                return(-1);
            }

            var cell = TableViewUtils.FindParent <TableViewCell>(uie);

            if (cell != null)
            {
                return(rowPresenter.ItemContainerGenerator.IndexFromContainer(cell));
            }

            return(-1);
        }
Esempio n. 2
0
        internal object GetItemAtLocation(Point loc)
        {
            var uie = InputHitTest(loc) as FrameworkElement;

            if (uie == null)
            {
                return(null);
            }

            var rowPresenter = TableViewUtils.GetAncestorByType <TableViewCellsPresenter>(uie);

            return(rowPresenter != null ? rowPresenter.Item : null);
        }
Esempio n. 3
0
        private void OnDragDelta(object sender, DragDeltaEventArgs e)
        {
            var tableViewColumnHeader = TableViewUtils.GetAncestorByType <TableViewColumnHeader>(this);

            if (tableViewColumnHeader == null)
            {
                return;
            }

            var width = tableViewColumnHeader.Width + e.HorizontalChange;

            tableViewColumnHeader.AdjustWidth(width);
        }
Esempio n. 4
0
        protected override void OnIsItemsHostChanged(bool oldIsItemsHost, bool newIsItemsHost)
        {
            base.OnIsItemsHostChanged(oldIsItemsHost, newIsItemsHost);

            var rowPresenter = TableViewUtils.FindParent <TableViewCellsPresenter>(this);

            if (rowPresenter == null)
            {
                return;
            }

            rowPresenter.CellsPanel = this;
            ParentTableView         = rowPresenter.ParentTableView;
            Style = ParentTableView.CellsPanelStyle;
        }
Esempio n. 5
0
        internal TableViewColumnHeader GetColumnHeaderAtLocation(Point loc)
        {
            var uie = InputHitTest(loc) as FrameworkElement;

            return(uie != null?TableViewUtils.FindParent <TableViewColumnHeader>(uie) : null);
        }