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)); }
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; } }
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; } } }