<pagemodel:PhonePageModel x:Key="PhonePageModel"></pagemodel:PhonePageModel>
<pagemodel:LanPageModel x:Key="LanPageModel"></pagemodel:LanPageModel>
<pagemodel:ControlsPageModel x:Key="ControlsPageModel"></pagemodel:ControlsPageModel>
+ <pagemodel:AboutPageModel x:Key="AboutPageModel"></pagemodel:AboutPageModel>
</ResourceDictionary>
</Application.Resources>
</Application>
--- /dev/null
+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));
+ }
+ }
+}
<Compile Include="Model\PhoneCallList.cs" />
<Compile Include="Model\StatusPhoneList.cs" />
<Compile Include="Model\SyslogList.cs" />
+ <Compile Include="PageModel\AboutPageModel.cs" />
<Compile Include="PageModel\ControlsPageModel.cs" />
<Compile Include="PageModel\DslPageModel.cs" />
<Compile Include="PageModel\LanPageModel.cs" />
Width="Auto" Height="Auto"
Title="AboutPage">
- <Grid>
+ <Grid DataContext="{StaticResource AboutPageModel}">
<TextBlock HorizontalAlignment="Left" Margin="10,10,0,0" TextWrapping="Wrap" Text="SpeedportHybridControl" VerticalAlignment="Top"/>
<TextBlock HorizontalAlignment="Left" Margin="10,31,0,0" TextWrapping="Wrap" Text="Copyright © 2015 stricted.net" VerticalAlignment="Top"/>
<TextBlock HorizontalAlignment="Left" Margin="10,52,0,0" TextWrapping="Wrap" Text="Version:" VerticalAlignment="Top"/>
<TextBlock x:Name="tbVersion" HorizontalAlignment="Left" Margin="57,52,0,0" TextWrapping="Wrap" VerticalAlignment="Top"/>
- <Button x:Name="btnBugtracker" Content="Bugtracker" HorizontalAlignment="Left" Margin="10,0,0,10" VerticalAlignment="Bottom" Click="button_click"/>
- <Button x:Name="btnUpdate" Content="Auf Update prüfen" HorizontalAlignment="Left" Margin="10,73,0,0" VerticalAlignment="Top" Click="button_click"/>
+ <Button Command="{Binding Path=BugtrackerCommand}" x:Name="btnBugtracker" Content="Bugtracker" HorizontalAlignment="Left" Margin="10,0,0,10" VerticalAlignment="Bottom"/>
+ <Button Command="{Binding Path=UpdateCommand}" x:Name="btnUpdate" Content="Auf Update prüfen" HorizontalAlignment="Left" Margin="10,73,0,0" VerticalAlignment="Top" />
- <Button x:Name="btnDonate" BorderBrush="Transparent" Background="Transparent" HorizontalAlignment="Right" Width="106" Height="48" VerticalAlignment="Bottom" Click="button_click" Margin="0,0,10,10">
+ <Button Command="{Binding Path=DonateCommand}" x:Name="btnDonate" BorderBrush="Transparent" Background="Transparent" HorizontalAlignment="Right" Width="106" Height="48" VerticalAlignment="Bottom" Margin="0,0,10,10">
<Image Source="../assets/btn_donateCC_LG.gif" x:Name="image" HorizontalAlignment="Left" VerticalAlignment="Top"/>
</Button>
</Grid>
-using System.Diagnostics;
-using System.Windows;
-using System.Windows.Controls;
-using System.Threading;
+using System.Windows.Controls;
namespace SpeedportHybridControl.page {
/// <summary>
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();
- }
- }
- */
- }
}
}