blob: 2dc8f7b6e0f5eba3e8a4d7624212d8a7fa1cef3a (
plain)
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.Core.Commands;
using Tango.SharedUI;
namespace Tango.PPC.UI.Dialogs
{
public class PowerEurekaViewVM : DialogViewVM
{
public enum PowerActionEnum { TurnOff, StandBy, Restart, RestartT };
private PowerActionEnum _powerAction;
public PowerActionEnum PowerAction
{
get { return _powerAction; }
set {
_powerAction = value;
RaisePropertyChangedAuto();}
}
public RelayCommand TurnOffCommand { get; set;}
public RelayCommand StandByCommand { get; set;}
public RelayCommand RestartCommand { get; set; }
public RelayCommand RestartTabletCommand { get; set; }
public PowerEurekaViewVM()
{
PowerAction = PowerActionEnum.StandBy;
TurnOffCommand = new RelayCommand( OnTurnOff);
StandByCommand = new RelayCommand(OnStandBy);
RestartCommand = new RelayCommand(OnRestart);
RestartTabletCommand = new RelayCommand(OnRestartTablet);
}
private void OnRestartTablet(object obj)
{
PowerAction = PowerActionEnum.RestartT;
base.Accept();
}
private void OnRestart(object obj)
{
PowerAction = PowerActionEnum.Restart;
base.Accept();
}
private void OnStandBy(object obj)
{
PowerAction = PowerActionEnum.StandBy;
base.Accept();
}
private void OnTurnOff(object obj)
{
PowerAction = PowerActionEnum.TurnOff;
base.Accept();
}
protected override void Cancel()
{
base.Cancel();
}
}
}
|