Exemple #1
0
        private double GetDropPositionFeedbackOffset(GridViewRow row, DropPosition dropPosition)
        {
            var yOffset = row.TransformToVisual(this.dropPositionFeedbackPresenterHost).Transform(new Point(0, 0)).Y;

            if (dropPosition == DropPosition.After)
            {
                yOffset += row.ActualHeight;
            }
            yOffset -= (this.dropPositionFeedbackPresenter.ActualHeight / 2.0);
            return(yOffset);
        }
Exemple #2
0
 public virtual DropPosition GetDropPositionFromPoint(Point absoluteMousePosition, GridViewRow row)
 {
     if (row != null)
     {
         var    headerTopPoint = row.TransformToVisual(Application.Current.RootVisual).Transform(new Point());
         double mouseTop       = absoluteMousePosition.Y - headerTopPoint.Y;
         if (mouseTop <= (row.ActualHeight * 2 / 4))
         {
             return(DropPosition.Before);
         }
         else if (mouseTop > (row.ActualHeight * 2 / 4))
         {
             return(DropPosition.After);
         }
     }
     return(DropPosition.Inside);
 }