fix ltepopup
[GitHub/Stricted/SpeedportHybridControl.git] / SpeedportHybridControl / PageModel / AboutPageModel.cs
1 using System;
2 using SpeedportHybridControl.Model;
3 using SpeedportHybridControl.Implementations;
4 using System.Diagnostics;
5 using System.Threading;
6 using System.Windows;
7
8 namespace SpeedportHybridControl.PageModel {
9 class AboutPageModel : SuperViewModel {
10 private DelegateCommand _donateCommand;
11 private DelegateCommand _bugtrackerCommand;
12 private DelegateCommand _updateCommand;
13
14 public string version
15 {
16 get { return MainWindowModel.VERSION; }
17 }
18
19 public DelegateCommand DonateCommand
20 {
21 get { return _donateCommand; }
22 set { SetProperty(ref _donateCommand, value); }
23 }
24
25 public DelegateCommand BugtrackerCommand
26 {
27 get { return _bugtrackerCommand; }
28 set { SetProperty(ref _bugtrackerCommand, value); }
29 }
30
31 public DelegateCommand UpdateCommand
32 {
33 get { return _updateCommand; }
34 set { SetProperty(ref _updateCommand, value); }
35 }
36
37 private void OnDonateCommandExecute () {
38 Process.Start("https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=E7EBAC5NP928J");
39 }
40
41 private void OnBugtrackerCommandExecute () {
42 Process.Start("https://stricted.net/bugtracker/index.php/ProductList/");
43 }
44
45 private void OnUpdateCommandExecute () {
46 if (util.checkUpdate(MainWindowModel.VERSION).Equals(true)) {
47 new Thread(() => { MessageBox.Show("Ein Update ist verfügbar.", "Confirmation", MessageBoxButton.OK, MessageBoxImage.Warning); }).Start();
48 }
49 else {
50 new Thread(() => { MessageBox.Show("SpeedportHybridControl ist auf dem neuesten Stand.", "Confirmation", MessageBoxButton.OK, MessageBoxImage.Information); }).Start();
51 }
52 }
53
54 public AboutPageModel () {
55 DonateCommand = new DelegateCommand(new Action(OnDonateCommandExecute));
56 BugtrackerCommand = new DelegateCommand(new Action(OnBugtrackerCommandExecute));
57 UpdateCommand = new DelegateCommand(new Action(OnUpdateCommandExecute));
58 }
59 }
60 }