-
Notifications
You must be signed in to change notification settings - Fork 80
Expand file tree
/
Copy pathBlockLimitViewModel.cs
More file actions
48 lines (41 loc) · 1.54 KB
/
BlockLimitViewModel.cs
File metadata and controls
48 lines (41 loc) · 1.54 KB
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
using VRage.Game;
namespace Torch.Server.ViewModels
{
public class BlockLimitViewModel : ViewModel
{
private SessionSettingsViewModel _sessionSettings;
private string _blockType;
private short _limit;
public string BlockType { get => _blockType; set { _blockType = value; OnPropertyChanged(); } }
public short Limit { get => _limit; set { _limit = value; OnPropertyChanged(); } }
//public CommandBinding Delete { get; } = new CommandBinding(new DeleteCommand());
public BlockLimitViewModel(SessionSettingsViewModel sessionSettings, string blockType, short limit)
{
_sessionSettings = sessionSettings;
_blockType = blockType;
_limit = limit;
}
/* TODO: figure out how WPF commands work
public class DeleteCommand : ICommand
{
/// <inheritdoc />
public bool CanExecute(object parameter)
{
return ((BlockLimitViewModel)parameter)._sessionSettings.BlockLimits.Contains(parameter);
}
/// <inheritdoc />
public void Execute(object parameter)
{
((BlockLimitViewModel)parameter)._sessionSettings.BlockLimits.Remove((BlockLimitViewModel)parameter);
}
/// <inheritdoc />
public event EventHandler CanExecuteChanged;
}*/
}
}