Skip to content

Commit d4c72df

Browse files
authored
Merge pull request #243 from miroiu/fix/242-independent-zooming
Fix editors in the calculator app sharing location and scaling
2 parents a9027bd + 217cb3e commit d4c72df

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

Examples/Nodify.Calculator/CalculatorViewModel.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,20 @@ public NodifyObservableCollection<OperationViewModel> SelectedOperations
9191
public PendingConnectionViewModel PendingConnection { get; set; } = new PendingConnectionViewModel();
9292
public OperationsMenuViewModel OperationsMenu { get; set; }
9393

94+
private double _zoom = 1.0f;
95+
public double Zoom
96+
{
97+
get => _zoom;
98+
set => SetProperty(ref _zoom, value);
99+
}
100+
101+
private Point _location;
102+
public Point Location
103+
{
104+
get => _location;
105+
set => SetProperty(ref _location, value);
106+
}
107+
94108
public INodifyCommand StartConnectionCommand { get; }
95109
public INodifyCommand CreateConnectionCommand { get; }
96110
public INodifyCommand DisconnectConnectorCommand { get; }

Examples/Nodify.Calculator/EditorView.xaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@
128128
<nodify:NodifyEditor DataContext="{Binding Calculator}"
129129
ItemsSource="{Binding Operations}"
130130
Connections="{Binding Connections}"
131+
ViewportZoom="{Binding Zoom}"
132+
ViewportLocation="{Binding Location}"
131133
SelectedItems="{Binding SelectedOperations}"
132134
DisconnectConnectorCommand="{Binding DisconnectConnectorCommand}"
133135
PendingConnection="{Binding PendingConnection}"

0 commit comments

Comments
 (0)