Skip to content

Commit 6ae4459

Browse files
authored
Added Connector methods to manage a pending connection (#166)
* Added Connector methods to manage a pending connection
1 parent 7f6768e commit 6ae4459

File tree

12 files changed

+430
-180
lines changed

12 files changed

+430
-180
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
> - Added HasCustomContextMenu dependency property to NodifyEditor and ItemContainer
2020
> - Added Select, BeginDragging, UpdateDragging, EndDragging and CancelDragging to ItemContainer
2121
> - Added PreserveSelectionOnRightClick configuration field to ItemContainer
22+
> - Added State, GetInitialState, PushState, PopState and PopAllStates to Connector
23+
> - Added BeginConnecting, UpdatePendingConnection, EndConnecting, CancelConnecting and RemoveConnections methods to Connector
2224
> - Bugfixes:
2325
> - Fixed an issue where the ItemContainer was selected by releasing the mouse button on it, even when the mouse was not captured
2426
> - Fixed an issue where the Home button caused the editor to fail to display items when contained within a ScrollViewer

Examples/Nodify.Playground/EditorSettings.cs

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,11 @@ private EditorSettings()
104104
val => Instance.AutoPanningEdgeDistance = val,
105105
"Auto panning edge distance: ",
106106
"Distance from edge to trigger auto panning"),
107+
new ProxySettingViewModel<bool>(
108+
() => Instance.EnableStickyConnectors,
109+
val => Instance.EnableStickyConnectors = val,
110+
"Enable sticky connectors: ",
111+
"The connection can be completed in two steps (e.g. click to create pending connection, click to connect)"),
107112
new ProxySettingViewModel<bool>(
108113
() => Instance.SelectableConnections,
109114
val => Instance.SelectableConnections = val,
@@ -225,6 +230,21 @@ private EditorSettings()
225230
val => Instance.AllowCuttingCancellation = val,
226231
"Allow cutting cancellation: ",
227232
"Right click to cancel cutting."),
233+
new ProxySettingViewModel<bool>(
234+
() => Instance.AllowPushItemsCancellation,
235+
val => Instance.AllowPushItemsCancellation = val,
236+
"Allow push nodes cancellation: ",
237+
"Right click to cancel pushing nodes."),
238+
new ProxySettingViewModel<bool>(
239+
() => Instance.AllowPanningCancellation,
240+
val => Instance.AllowPanningCancellation= val,
241+
"Allow panning cancellation: ",
242+
"Press Escape to cancel panning."),
243+
new ProxySettingViewModel<bool>(
244+
() => Instance.AllowSelectionCancellation,
245+
val => Instance.AllowSelectionCancellation = val,
246+
"Allow selection cancellation: ",
247+
"Press Escape to cancel selecting."),
228248
new ProxySettingViewModel<bool>(
229249
() => Instance.AllowDraggingCancellation,
230250
val => Instance.AllowDraggingCancellation = val,
@@ -285,11 +305,6 @@ private EditorSettings()
285305
val => Instance.FitToScreenExtentMargin = val,
286306
"Fit to screen extent margin: ",
287307
"Adds some margin to the nodes extent when fit to screen"),
288-
new ProxySettingViewModel<bool>(
289-
() => Instance.EnableStickyConnectors,
290-
val => Instance.EnableStickyConnectors = val,
291-
"Enable sticky connectors: ",
292-
"The connection can be completed in two steps (e.g. click to create pending connection, click to connect)"),
293308
};
294309

295310
EnableCuttingLinePreview = true;
@@ -603,6 +618,24 @@ public bool AllowCuttingCancellation
603618
set => CuttingLine.AllowCuttingCancellation = value;
604619
}
605620

621+
public bool AllowPushItemsCancellation
622+
{
623+
get => NodifyEditor.AllowPushItemsCancellation;
624+
set => NodifyEditor.AllowPushItemsCancellation = value;
625+
}
626+
627+
public bool AllowPanningCancellation
628+
{
629+
get => NodifyEditor.AllowPanningCancellation;
630+
set => NodifyEditor.AllowPanningCancellation = value;
631+
}
632+
633+
public bool AllowSelectionCancellation
634+
{
635+
get => NodifyEditor.AllowSelectionCancellation;
636+
set => NodifyEditor.AllowSelectionCancellation = value;
637+
}
638+
606639
public bool AllowDraggingCancellation
607640
{
608641
get => ItemContainer.AllowDraggingCancellation;

0 commit comments

Comments
 (0)