Exemple #1
0
        internal void UpdatePosition()
        {
            if (updating)
            {
                return;
            }
            updating = true;

            Point point = MouseUtilities.GetPosition(Owner);

            if ((point.X < 5.0) || (point.Y < 5.0) ||
                (point.X > (Owner.ActualWidth - 5.0)) ||
                (point.Y > (Owner.ActualHeight - 5.0)))
            {
                Hide();
            }

            top = point.Y - 40;
            if (isRightToLeft)
            {
                left = Owner.ActualWidth - point.X - 25;
            }
            else
            {
                left = point.X - 25;
            }

            adornerLayer.Update(this.AdornedElement);

            updating = false;
        }
Exemple #2
0
        private void parentWindow_MouseMove(object sender, MouseEventArgs e)
        {
            if (!isMouseDown)
            {
                return;
            }

            if ((e.LeftButton == MouseButtonState.Pressed) || (e.RightButton == MouseButtonState.Pressed))
            {
                if (Visible)
                {
                    updatePosition(MouseUtilities.GetPosition(ParentElement));
                }
                else
                {
                    show();
                }
            }
            else
            {
                hide();
            }
        }