From: Stricted Date: Wed, 11 Nov 2015 23:05:30 +0000 (+0100) Subject: update About page X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5bc19839c120a6d816e052cf5f30460c69f4fedf;p=GitHub%2FStricted%2FSpeedportHybridControl.git update About page --- diff --git a/SpeedportHybridControl/App.xaml b/SpeedportHybridControl/App.xaml index d510c23..34c0c8c 100644 --- a/SpeedportHybridControl/App.xaml +++ b/SpeedportHybridControl/App.xaml @@ -19,6 +19,7 @@ + diff --git a/SpeedportHybridControl/PageModel/AboutPageModel.cs b/SpeedportHybridControl/PageModel/AboutPageModel.cs new file mode 100644 index 0000000..05e42d5 --- /dev/null +++ b/SpeedportHybridControl/PageModel/AboutPageModel.cs @@ -0,0 +1,52 @@ +using System; +using SpeedportHybridControl.Model; +using SpeedportHybridControl.Implementations; +using System.Diagnostics; +using System.Threading; +using System.Windows; + +namespace SpeedportHybridControl.PageModel { + class AboutPageModel : SuperViewModel { + private DelegateCommand _donateCommand; + private DelegateCommand _bugtrackerCommand; + private DelegateCommand _updateCommand; + + public DelegateCommand DonateCommand { + get { return _donateCommand; } + set { SetProperty(ref _donateCommand, value); } + } + + public DelegateCommand BugtrackerCommand { + get { return _bugtrackerCommand; } + set { SetProperty(ref _bugtrackerCommand, value); } + } + + public DelegateCommand UpdateCommand { + get { return _updateCommand; } + set { SetProperty(ref _updateCommand, value); } + } + + private void OnDonateCommandExecute () { + Process.Start("https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=E7EBAC5NP928J"); + } + + private void OnBugtrackerCommandExecute () { + Process.Start("https://stricted.net/bugtracker/index.php/ProductList/"); + } + + private void OnUpdateCommandExecute () { + if (util.checkUpdate(MainWindowModel.VERSION).Equals(true)) { + new Thread(() => { MessageBox.Show("Ein Update ist verfügbar.", "Confirmation", MessageBoxButton.OK, MessageBoxImage.Warning); }).Start(); + } + else { + new Thread(() => { MessageBox.Show("SpeedportHybridControl ist auf dem neuesten Stand.", "Confirmation", MessageBoxButton.OK, MessageBoxImage.Information); }).Start(); + } + } + + public AboutPageModel () { + DonateCommand = new DelegateCommand(new Action(OnDonateCommandExecute)); + BugtrackerCommand = new DelegateCommand(new Action(OnBugtrackerCommandExecute)); + UpdateCommand = new DelegateCommand(new Action(OnUpdateCommandExecute)); + } + } +} diff --git a/SpeedportHybridControl/SpeedportHybridControl.csproj b/SpeedportHybridControl/SpeedportHybridControl.csproj index c1957de..8b32518 100644 --- a/SpeedportHybridControl/SpeedportHybridControl.csproj +++ b/SpeedportHybridControl/SpeedportHybridControl.csproj @@ -77,6 +77,7 @@ + diff --git a/SpeedportHybridControl/page/AboutPage.xaml b/SpeedportHybridControl/page/AboutPage.xaml index 8924964..405c994 100644 --- a/SpeedportHybridControl/page/AboutPage.xaml +++ b/SpeedportHybridControl/page/AboutPage.xaml @@ -8,18 +8,18 @@ Width="Auto" Height="Auto" Title="AboutPage"> - + - diff --git a/SpeedportHybridControl/page/AboutPage.xaml.cs b/SpeedportHybridControl/page/AboutPage.xaml.cs index f81bdef..dbc6581 100644 --- a/SpeedportHybridControl/page/AboutPage.xaml.cs +++ b/SpeedportHybridControl/page/AboutPage.xaml.cs @@ -1,7 +1,4 @@ -using System.Diagnostics; -using System.Windows; -using System.Windows.Controls; -using System.Threading; +using System.Windows.Controls; namespace SpeedportHybridControl.page { /// @@ -10,26 +7,6 @@ namespace SpeedportHybridControl.page { public partial class AboutPage : Page { public AboutPage () { InitializeComponent(); - //tbVersion.Text = MainWindow.VERSION; } - - private void button_click (object sender, RoutedEventArgs e) { - /* - if (sender.Equals(btnDonate)) { - Process.Start("https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=E7EBAC5NP928J"); - } - else if (sender.Equals(btnBugtracker)) { - Process.Start("https://stricted.net/bugtracker/index.php/ProductList/"); - } - else if (sender.Equals(btnUpdate)) { - if (util.checkUpdate().Equals(true)) { - new Thread(() => { MessageBox.Show("Ein Update ist verfügbar.", "Confirmation", MessageBoxButton.OK, MessageBoxImage.Warning); }).Start(); - } - else { - new Thread(() => { MessageBox.Show("SpeedportHybridControl ist auf dem neuesten Stand.", "Confirmation", MessageBoxButton.OK, MessageBoxImage.Information); }).Start(); - } - } - */ - } } }