-
-
Notifications
You must be signed in to change notification settings - Fork 239
/
Copy pathConnectorViewModel.cs
53 lines (46 loc) · 1.33 KB
/
ConnectorViewModel.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
using System.Collections.Generic;
using System.Windows;
namespace Nodify.Calculator
{
public class ConnectorViewModel : ObservableObject
{
private string? _title;
public string? Title
{
get => _title;
set => SetProperty(ref _title, value);
}
private double _value;
public double Value
{
get => _value;
set => SetProperty(ref _value, value)
.Then(() => ValueObservers.ForEach(o => o.Value = value));
}
private bool _isConnected;
public bool IsConnected
{
get => _isConnected;
set => SetProperty(ref _isConnected, value);
}
private bool _isInput;
public bool IsInput
{
get => _isInput;
set => SetProperty(ref _isInput, value);
}
private Point _anchor;
public Point Anchor
{
get => _anchor;
set => SetProperty(ref _anchor, value);
}
private OperationViewModel _operation = default!;
public OperationViewModel Operation
{
get => _operation;
set => SetProperty(ref _operation, value);
}
public List<ConnectorViewModel> ValueObservers { get; } = new List<ConnectorViewModel>();
}
}