-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathShellViewModel.cs
55 lines (48 loc) · 1.35 KB
/
ShellViewModel.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
54
55
using Prism.Commands;
using Prism.Mvvm;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Net6PopupProblem
{
public class ShellViewModel : BindableBase
{
public ShellViewModel()
{
_popupsManager = new PopupsManager
{
Title = "Pay menu"
};
PayCommand = new DelegateCommand(ExecutePayCommand, CanExecuteSaveCommand).ObservesProperty(() => Sum);
}
#region PopupsManager
private PopupsManager _popupsManager;
public PopupsManager PopupsManager
{
get => _popupsManager;
set => SetProperty(ref _popupsManager, value);
}
#endregion //PopupsOpened
#region Sum
private decimal _sum;
public decimal Sum
{
get => _sum;
set => SetProperty(ref _sum, value);
}
#endregion //Sum
#region PayCommand
public DelegateCommand PayCommand { get; set; }
public void ExecutePayCommand()
{
_popupsManager.PaymentIsOpen = false;
}
public virtual bool CanExecuteSaveCommand()
{
return Sum > 0;
}
#endregion //PayCommand
}
}