示例#1
0
        private async Task LockObject()
        {
            //selectedItem.isModified = true;
            SfDiagram diagram = Parent.DiagramContent.Diagram;

            for (var i = 0; i < diagram.SelectedItems.Nodes.Count; i++)
            {
                var node = diagram.SelectedItems.Nodes[i];
                if (node.Constraints.HasFlag(NodeConstraints.Drag))
                {
                    node.Constraints = NodeConstraints.PointerEvents | NodeConstraints.Select;
                }
                else
                {
                    node.Constraints = NodeConstraints.Default;
                }
            }
            for (var j = 0; j < diagram.SelectedItems.Connectors.Count; j++)
            {
                var connector = diagram.SelectedItems.Connectors[j];
                if (connector.Constraints.HasFlag(ConnectorConstraints.Drag))
                {
                    connector.Constraints = ConnectorConstraints.PointerEvents | ConnectorConstraints.Select;
                }
                else
                {
                    connector.Constraints = ConnectorConstraints.Default;
                }
            }
            await diagram.DataBind().ConfigureAwait(true);
        }