From: Stricted Date: Wed, 11 Nov 2015 22:07:05 +0000 (+0100) Subject: update Lan Page X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=cd5bc2bef7c2c4887ccc216049d78ecc98c8efee;p=GitHub%2FStricted%2FSpeedportHybridControl.git update Lan Page --- diff --git a/SpeedportHybridControl/App.xaml b/SpeedportHybridControl/App.xaml index b4a7629..5c0bcff 100644 --- a/SpeedportHybridControl/App.xaml +++ b/SpeedportHybridControl/App.xaml @@ -17,8 +17,7 @@ - - + diff --git a/SpeedportHybridControl/Model/DeviceList.cs b/SpeedportHybridControl/Model/DeviceList.cs new file mode 100644 index 0000000..eae8e6b --- /dev/null +++ b/SpeedportHybridControl/Model/DeviceList.cs @@ -0,0 +1,55 @@ +namespace SpeedportHybridControl.Model { + public class DeviceList : SuperViewModel { + private int _id; + private string _name; + private string _mac; + private int _type; + private int _connected; + private string _ipv4; + private string _ipv6; + private int _static; + + public int id { + get { return _id; } + set { SetProperty(ref _id, value); } + } + + public string name { + get { return _name; } + set { SetProperty(ref _name, value); } + } + + public string mac { + get { return _mac; } + set { SetProperty(ref _mac, value); } + } + + public int type { + get { return _type; } + set { SetProperty(ref _type, value); } + } + + public int connected { + get { return _connected; } + set { SetProperty(ref _connected, value); } + } + + public string ipv4 { + get { return _ipv4; } + set { SetProperty(ref _ipv4, value); } + } + + public string ipv6 { + get { return _ipv6; } + set { SetProperty(ref _ipv6, value); } + } + + public int mstatic { + get { return _static; } + set { SetProperty(ref _static, value); } + } + + public DeviceList() { + } + } +} diff --git a/SpeedportHybridControl/Model/DeviceViewModel.cs b/SpeedportHybridControl/Model/DeviceViewModel.cs deleted file mode 100644 index ee69b48..0000000 --- a/SpeedportHybridControl/Model/DeviceViewModel.cs +++ /dev/null @@ -1,75 +0,0 @@ -using System.Collections.Generic; - -namespace SpeedportHybridControl.Model { - public class DeviceData : SuperViewModel { - private List _deviceList; - private string _datetime; - - public List deviceList { - get { return _deviceList; } - set { SetProperty(ref _deviceList, value); } - } - - public string datetime { - get { return _datetime; } - set { SetProperty(ref _datetime, value); } - } - - public DeviceData() { - } - } - - public class DeviceList : SuperViewModel { - private int _id; - private string _name; - private string _mac; - private int _type; - private int _connected; - private string _ipv4; - private string _ipv6; - private int _static; - - public int id { - get { return _id; } - set { SetProperty(ref _id, value); } - } - - public string name { - get { return _name; } - set { SetProperty(ref _name, value); } - } - - public string mac { - get { return _mac; } - set { SetProperty(ref _mac, value); } - } - - public int type { - get { return _type; } - set { SetProperty(ref _type, value); } - } - - public int connected { - get { return _connected; } - set { SetProperty(ref _connected, value); } - } - - public string ipv4 { - get { return _ipv4; } - set { SetProperty(ref _ipv4, value); } - } - - public string ipv6 { - get { return _ipv6; } - set { SetProperty(ref _ipv6, value); } - } - - public int mstatic { - get { return _static; } - set { SetProperty(ref _static, value); } - } - - public DeviceList() { - } - } -} diff --git a/SpeedportHybridControl/PageModel/LanPageModel.cs b/SpeedportHybridControl/PageModel/LanPageModel.cs new file mode 100644 index 0000000..9f7f8e4 --- /dev/null +++ b/SpeedportHybridControl/PageModel/LanPageModel.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using SpeedportHybridControl.Data; +using SpeedportHybridControl.Model; +using SpeedportHybridControl.Implementations; +using System.Threading; + +namespace SpeedportHybridControl.PageModel { + class LanPageModel : SuperViewModel { + private DelegateCommand _reloadCommand; + + private List _deviceList; + private string _datetime; + + public DelegateCommand ReloadCommand { + get { return _reloadCommand; } + set { SetProperty(ref _reloadCommand, value); } + } + + public List deviceList { + get { return _deviceList; } + set { SetProperty(ref _deviceList, value); } + } + + public string datetime { + get { return _datetime; } + set { SetProperty(ref _datetime, value); } + } + + private void OnReloadCommandExecute () { + new Thread(() => { SpeedportHybrid.initLan(); }).Start(); + } + + public LanPageModel () { + ReloadCommand = new DelegateCommand(new Action(OnReloadCommandExecute)); + } + } +} diff --git a/SpeedportHybridControl/PageModel/TR181PageModel.cs b/SpeedportHybridControl/PageModel/TR181PageModel.cs index 151203c..c25cb70 100644 --- a/SpeedportHybridControl/PageModel/TR181PageModel.cs +++ b/SpeedportHybridControl/PageModel/TR181PageModel.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using SpeedportHybridControl.Data; using SpeedportHybridControl.Model; using SpeedportHybridControl.Implementations; diff --git a/SpeedportHybridControl/SpeedportHybridControl.csproj b/SpeedportHybridControl/SpeedportHybridControl.csproj index 4ae83d9..488db6e 100644 --- a/SpeedportHybridControl/SpeedportHybridControl.csproj +++ b/SpeedportHybridControl/SpeedportHybridControl.csproj @@ -72,12 +72,13 @@ - + + diff --git a/SpeedportHybridControl/page/LanPage.xaml b/SpeedportHybridControl/page/LanPage.xaml index afb1f31..e0935fb 100644 --- a/SpeedportHybridControl/page/LanPage.xaml +++ b/SpeedportHybridControl/page/LanPage.xaml @@ -1,14 +1,14 @@  - +