private void MoveAction(DragAndDropArgs args, ActionTreeViewItem row) { var action = (ActionTreeItem)row; var dstIndex = args.insertAtIndex; var srcIndex = action.index; if (dstIndex > srcIndex) { dstIndex--; } InputActionSerializationHelpers.MoveAction(actionMapProperty, srcIndex, dstIndex); }