示例#1
0
        private void DoReordering(MouseEventArgs e)
        {
            e.Handled = true;
            Point position = e.GetPosition((IInputElement)this);

            ArrangePanel.SetOrder((DependencyObject)this._draggingObject, this._strategy.GetIndex(position));
            ArrangePanel.SetPosition((DependencyObject)this._draggingObject, new Rect(position + this._delta, ArrangePanel.GetPosition((DependencyObject)this._draggingObject).Size));
        }
示例#2
0
        private void InitializeEmptyOrder()
        {
            int num = this.Children.OfType <UIElement>().Max <UIElement>((Func <UIElement, int>)(ch => ArrangePanel.GetOrder((DependencyObject)ch))) + 1;

            foreach (DependencyObject dependencyObject in this.Children.OfType <UIElement>().Where <UIElement>((Func <UIElement, bool>)(child => ArrangePanel.GetOrder((DependencyObject)child) == -1)))
            {
                ArrangePanel.SetOrder(dependencyObject, num);
                ++num;
            }
        }
示例#3
0
        private void ReorderOthers()
        {
            int order1 = ArrangePanel.GetOrder((DependencyObject)this._draggingObject);
            int num    = 0;

            foreach (UIElement uiElement in (IEnumerable <UIElement>) this.Children.OfType <UIElement>().OrderBy <UIElement, int>(new Func <UIElement, int>(ArrangePanel.GetOrder)))
            {
                if (num == order1)
                {
                    ++num;
                }
                if (uiElement != this._draggingObject)
                {
                    int order2 = ArrangePanel.GetOrder((DependencyObject)uiElement);
                    if (num != order2)
                    {
                        ArrangePanel.SetOrder((DependencyObject)uiElement, num);
                    }
                    ++num;
                }
            }
        }