forked from miroiu/nodify
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TransitionViewModel.cs
48 lines (42 loc) · 1.31 KB
/
TransitionViewModel.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
namespace Nodify.StateMachine
{
public class TransitionViewModel : ObservableObject
{
private StateViewModel _source = default!;
public StateViewModel Source
{
get => _source;
set => SetProperty(ref _source, value);
}
private StateViewModel _target = default!;
public StateViewModel Target
{
get => _target;
set => SetProperty(ref _target, value);
}
private BlackboardItemReferenceViewModel? _conditionReference;
public BlackboardItemReferenceViewModel? ConditionReference
{
get => _conditionReference;
set
{
if (SetProperty(ref _conditionReference, value))
{
SetCondition(_conditionReference);
}
}
}
public BlackboardItemViewModel? Condition { get; private set; }
private bool _isActive;
public bool IsActive
{
get => _isActive;
set => SetProperty(ref _isActive, value);
}
private void SetCondition(BlackboardItemReferenceViewModel? conditionRef)
{
Condition = BlackboardDescriptor.GetItem(conditionRef);
OnPropertyChanged(nameof(Condition));
}
}
}