/// <summary> /// Moves the layer specified by index <paramref name="layerNumber"/> as specified by the user in the opened dialog. /// </summary> /// <param name="doc">Graph document.</param> /// <param name="layerNumber">Number of the layer to move.</param> public static void ShowMoveLayerToPositionDialog(this GraphDocument doc, IList <int> layerNumber) { if (!doc.RootLayer.IsValidIndex(layerNumber, out var layer)) { return; } var ivictrl = new Altaxo.Gui.Common.IntegerValueInputController(0, "Please enter the new position (>=0):") { Validator = new Altaxo.Gui.Common.IntegerValueInputController.ZeroOrPositiveIntegerValidator() }; int newposition; if (!Current.Gui.ShowDialog(ivictrl, "New position", false)) { return; } newposition = ivictrl.EnteredContents; MoveLayerToPosition(doc, layer.ParentLayer, layerNumber[layerNumber.Count - 1], newposition); }
/// <summary> /// Moves the layer specified by index <paramref name="layerNumber"/> as specified by the user in the opened dialog. /// </summary> /// <param name="doc">Graph document.</param> /// <param name="layerNumber">Number of the layer to move.</param> public static void ShowMoveLayerToPositionDialog(this GraphDocument doc, IList<int> layerNumber) { HostLayer layer; if (!doc.RootLayer.IsValidIndex(layerNumber, out layer)) return; var ivictrl = new Altaxo.Gui.Common.IntegerValueInputController(0, "Please enter the new position (>=0):"); ivictrl.Validator = new Altaxo.Gui.Common.IntegerValueInputController.ZeroOrPositiveIntegerValidator(); int newposition; if (!Current.Gui.ShowDialog(ivictrl, "New position", false)) return; newposition = ivictrl.EnteredContents; MoveLayerToPosition(doc, layer.ParentLayer, layerNumber[layerNumber.Count - 1], newposition); }