forked from miroiu/nodify
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOperationGraphViewModel.cs
44 lines (40 loc) · 1.13 KB
/
OperationGraphViewModel.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
using System.Windows;
namespace Nodify.Calculator
{
public class OperationGraphViewModel : CalculatorOperationViewModel
{
private Size _size;
public Size DesiredSize
{
get => _size;
set => SetProperty(ref _size, value);
}
private Size _prevSize;
private bool _isExpanded = true;
public bool IsExpanded
{
get => _isExpanded;
set
{
if (SetProperty(ref _isExpanded, value))
{
if (_isExpanded)
{
DesiredSize = _prevSize;
}
else
{
_prevSize = Size;
// Fit content
DesiredSize = new Size(double.NaN, double.NaN);
}
}
}
}
public OperationGraphViewModel()
{
InnerCalculator.Operations[0].Location = new Point(50, 50);
InnerCalculator.Operations[1].Location = new Point(200, 50);
}
}
}