|
5 | 5 |
|
6 | 6 | <div class="d-flex flex-column gap-3"> |
7 | 7 | <div class="d-flex align-items-center gap-3 p-3 bg-light rounded"> |
8 | | - <SfButton Content="Update Selected Connectors (Max 5)" IsPrimary="true" OnClick="UpdateSelectedConnectorThumbs" |
9 | | - CssClass="btn-selected"> |
| 8 | + <SfButton Content="Update Selected Connectors (Max 5)" IsPrimary="true" OnClick="UpdateSelectedConnectorThumbs" CssClass="btn-selected"> |
10 | 9 | </SfButton> |
11 | 10 | <SfButton Content="Update All Connectors (Max 6)" OnClick="UpdateAllConnectorThumbs"CssClass="btn-all"> |
12 | 11 | </SfButton> |
|
21 | 20 |
|
22 | 21 | protected override void OnInitialized() |
23 | 22 | { |
24 | | - // Create orthogonal connector with custom segments and styling |
| 23 | + // Create orthogonal connector with custom segments and styling. |
25 | 24 | Connector orthogonalConnector = new Connector() |
26 | 25 | { |
27 | 26 | ID = "orthogonal", |
28 | 27 | SourcePoint = new DiagramPoint() { X = 550, Y = 200 }, |
29 | 28 | TargetPoint = new DiagramPoint() { X = 650, Y = 300 }, |
30 | 29 | Style = new ShapeStyle() { StrokeColor = "#6495ED" }, |
31 | | - |
32 | | - // Enable dragging segment thumbs |
33 | 30 | Constraints = ConnectorConstraints.Default | ConnectorConstraints.DragSegmentThumb, |
34 | | - |
35 | 31 | TargetDecorator = new DecoratorSettings() |
36 | 32 | { |
37 | 33 | Shape = DecoratorShape.Arrow, |
38 | 34 | Style = new ShapeStyle() { StrokeColor = "#6495ED", Fill = "#6495ED" } |
39 | 35 | }, |
40 | | - |
41 | | - // Orthogonal connector |
42 | 36 | Type = ConnectorSegmentType.Orthogonal, |
43 | | - |
44 | | - // Define orthogonal segments (Type on each segment is redundant and omitted) |
| 37 | + // Define orthogonal segments (Type on each segment is redundant and omitted). |
45 | 38 | Segments = new DiagramObjectCollection<ConnectorSegment>() |
46 | 39 | { |
47 | 40 | new OrthogonalSegment |
|
57 | 50 | Direction = Direction.Bottom |
58 | 51 | } |
59 | 52 | }, |
60 | | - |
61 | | - // Limit the number of visible/draggable segment thumbs |
| 53 | + // Limit the number of visible/draggable segment thumbs. |
62 | 54 | MaxSegmentThumbs = 2 |
63 | | - |
64 | 55 | }; |
65 | 56 | connectors.Add(orthogonalConnector); |
66 | 57 | } |
67 | 58 |
|
68 | | - // Updates MaxSegmentThumbs to 5 for all currently selected connectors at runtime |
| 59 | + // Updates MaxSegmentThumbs to 5 for all currently selected connectors at runtime. |
69 | 60 | private void UpdateSelectedConnectorThumbs() |
70 | 61 | { |
71 | 62 | if (diagram?.SelectionSettings?.Connectors != null) |
72 | 63 | { |
73 | 64 | for (int i = 0; i < diagram.SelectionSettings.Connectors.Count; i++) |
74 | 65 | { |
75 | | - // Set segment thumb limit for selected connector only |
| 66 | + // Set segment thumb limit for selected connector only. |
76 | 67 | diagram.SelectionSettings.Connectors[i].MaxSegmentThumbs = 5; |
77 | 68 | } |
78 | 69 | } |
79 | 70 | } |
80 | 71 |
|
81 | | - // Updates MaxSegmentThumbs to 6 for all connectors in the diagram at runtime |
| 72 | + // Updates MaxSegmentThumbs to 6 for all connectors in the diagram at runtime. |
82 | 73 | private void UpdateAllConnectorThumbs() |
83 | 74 | { |
84 | 75 | if (diagram?.Connectors != null) |
85 | 76 | { |
86 | 77 | for (int i = 0; i < diagram.Connectors.Count; i++) |
87 | 78 | { |
88 | | - // Set segment thumb limit for each connector in diagram |
| 79 | + // Set segment thumb limit for each connector in diagram. |
89 | 80 | diagram.Connectors[i].MaxSegmentThumbs = 6; |
90 | 81 | } |
91 | 82 | } |
|
0 commit comments