update TR181 and Phone page
authorStricted <info@stricted.de>
Wed, 11 Nov 2015 21:37:43 +0000 (22:37 +0100)
committerStricted <info@stricted.de>
Wed, 11 Nov 2015 21:37:43 +0000 (22:37 +0100)
18 files changed:
SpeedportHybridControl/App.xaml
SpeedportHybridControl/Data/SpeedportHybrid.cs
SpeedportHybridControl/Data/SpeedportHybridAPI.cs
SpeedportHybridControl/Model/PhoneCallList.cs [new file with mode: 0644]
SpeedportHybridControl/Model/PhoneCallViewModel.cs [deleted file]
SpeedportHybridControl/Model/StatusPhoneList.cs [new file with mode: 0644]
SpeedportHybridControl/Model/StatusPhoneListModel.cs [deleted file]
SpeedportHybridControl/Model/TR181ViewModel.cs [deleted file]
SpeedportHybridControl/PageModel/PhonePageModel.cs [new file with mode: 0644]
SpeedportHybridControl/PageModel/StatusPageModel.cs
SpeedportHybridControl/PageModel/SyslogPageModel.cs
SpeedportHybridControl/PageModel/TR181PageModel.cs [new file with mode: 0644]
SpeedportHybridControl/SpeedportHybridControl.csproj
SpeedportHybridControl/page/PhonePage.xaml
SpeedportHybridControl/page/PhonePage.xaml.cs
SpeedportHybridControl/page/SyslogPage.xaml
SpeedportHybridControl/page/TR181Page.xaml
SpeedportHybridControl/page/TR181Page.xaml.cs

index 5618ea558ab56f78076ea8594d338eab9340f217..b4a76290fbaac7fed726e9b27cafd8042275b288 100644 (file)
@@ -15,9 +15,9 @@
             <pagemodel:DslPageModel x:Key="DslPageModel"></pagemodel:DslPageModel>
             <pagemodel:LteInfoModel x:Key="LteInfoModel"></pagemodel:LteInfoModel>
             <pagemodel:SyslogPageModel x:Key="SyslogPageModel"></pagemodel:SyslogPageModel>
+            <pagemodel:TR181PageModel x:Key="TR181PageModel"></pagemodel:TR181PageModel>
+            <pagemodel:PhonePageModel x:Key="PhonePageModel"></pagemodel:PhonePageModel>
             
-            <model:TR181 x:Key="TR181"></model:TR181>
-            <model:PhoneCallData x:Key="PhoneCallData"></model:PhoneCallData>
             <model:DeviceData x:Key="DeviceData"></model:DeviceData>
         </ResourceDictionary>
     </Application.Resources>
index 6710f6bad290ece0de67e00704beea104d920805..27ac08e2132ff6eff7e8cad61b80043511042f3e 100644 (file)
@@ -253,13 +253,13 @@ namespace SpeedportHybridControl.Data {
                                if (SpeedportHybridAPI.getInstance().checkLogin().Equals(false))
                                        return;
 
-                               TR181 tr181 = Application.Current.FindResource("TR181") as TR181;
+                               TR181PageModel tr181 = Application.Current.FindResource("TR181PageModel") as TR181PageModel;
 
                                string response = SpeedportHybridAPI.getInstance().sendEnryptedRequest("data/bonding_tr181.json");
                                if (response.IsNullOrEmpty())
                                        return;
 
-                               TR181 obj = JsonConvert.DeserializeObject<TR181>(response);
+                               TR181PageModel obj = JsonConvert.DeserializeObject<TR181PageModel>(response);
                                response = null;
 
                                tr181.enable1 = obj.enable1;
@@ -274,7 +274,7 @@ namespace SpeedportHybridControl.Data {
 
                                response = SpeedportHybridAPI.getInstance().sendEnryptedRequest("data/bonding_tunnel.json");
 
-                               obj = JsonConvert.DeserializeObject<TR181>(response);
+                               obj = JsonConvert.DeserializeObject<TR181PageModel>(response);
                                response = null;
 
                                tr181.lte_tunnel = obj.lte_tunnel;
@@ -451,7 +451,7 @@ namespace SpeedportHybridControl.Data {
                                status.dsl_downstream = string.Concat(jArray.getVar("dsl_downstream"), " kBit/s");
                                status.dsl_upstream = string.Concat(jArray.getVar("dsl_upstream"), " kBit/s");
 
-                               List<StatusPhoneListModel> statusPhoneList = new List<StatusPhoneListModel>();
+                               List<StatusPhoneList> statusPhoneList = new List<StatusPhoneList>();
                                status.addphonenumber = null;
 
                                foreach (JToken jToken in jArray) {
@@ -466,7 +466,7 @@ namespace SpeedportHybridControl.Data {
                                                        pstatus = "Nicht aktiv";
                                                }
 
-                                               statusPhoneList.Add(new StatusPhoneListModel() { number = pnumber, status = pstatus });
+                                               statusPhoneList.Add(new StatusPhoneList() { number = pnumber, status = pstatus });
                                        }
                                }
 
@@ -656,7 +656,7 @@ namespace SpeedportHybridControl.Data {
                                if (SpeedportHybridAPI.getInstance().checkLogin().Equals(false))
                                        return;
 
-                               PhoneCallData phone = Application.Current.FindResource("PhoneCallData") as PhoneCallData;
+                               PhonePageModel phone = Application.Current.FindResource("PhonePageModel") as PhonePageModel;
 
                                List<PhoneCallList> missedCalls = new List<PhoneCallList>();
                                List<PhoneCallList> takenCalls = new List<PhoneCallList>();
index 23bacc87bedeb43690553e0c274b2b971fd39245..3535f049f50225d98f808e41f9dd2c498f05f675 100644 (file)
@@ -569,7 +569,7 @@ namespace SpeedportHybridControl.Data {
                        if (response.IsNullOrEmpty())
                                return;
                        try {
-                               TR181 obj = JsonConvert.DeserializeObject<TR181>(response);
+                               TR181PageModel obj = JsonConvert.DeserializeObject<TR181PageModel>(response);
 
                                if (obj.QueueSkbTimeOut.Equals(value)) {
                                        new Thread(() => { MessageBox.Show("QueueSkbTimeOut geändert", "Confirmation", MessageBoxButton.OK, MessageBoxImage.Information); }).Start();
diff --git a/SpeedportHybridControl/Model/PhoneCallList.cs b/SpeedportHybridControl/Model/PhoneCallList.cs
new file mode 100644 (file)
index 0000000..58f01a9
--- /dev/null
@@ -0,0 +1,41 @@
+namespace SpeedportHybridControl.Model {
+       public class PhoneCallList : SuperViewModel {
+               private int _id;
+               private string _date;
+               private string _time;
+               private string _who;
+               private string _duration;
+
+               public int id {
+                       get { return _id; }
+                       set { SetProperty(ref _id, value); }
+               }
+
+               public string date {
+                       get { return _date; }
+                       set { SetProperty(ref _date, value); }
+               }
+
+               public string time {
+                       get { return _time; }
+                       set { SetProperty(ref _time, value); }
+               }
+
+               public string who {
+                       get { return _who; }
+                       set { SetProperty(ref _who, value); }
+               }
+
+               public string duration {
+                       get { return _duration; }
+                       set { SetProperty(ref _duration, value); }
+               }
+
+               public override string ToString () {
+                       return string.Concat(date, " ", time, " ", who, " ", duration);
+               }
+
+               public PhoneCallList () {
+               }
+       }
+}
diff --git a/SpeedportHybridControl/Model/PhoneCallViewModel.cs b/SpeedportHybridControl/Model/PhoneCallViewModel.cs
deleted file mode 100644 (file)
index 8f5d57f..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-using System.Collections.Generic;
-
-namespace SpeedportHybridControl.Model {
-       public class PhoneCallData : SuperViewModel {
-               private List<PhoneCallList> _missedCalls;
-               private List<PhoneCallList> _takenCalls;
-               private List<PhoneCallList> _dialedCalls;
-               private string _datetime;
-
-               public List<PhoneCallList> missedCalls {
-                       get { return _missedCalls; }
-                       set { SetProperty(ref _missedCalls, value); }
-               }
-
-               public List<PhoneCallList> takenCalls {
-                       get { return _takenCalls; }
-                       set { SetProperty(ref _takenCalls, value); }
-               }
-
-               public List<PhoneCallList> dialedCalls {
-                       get { return _dialedCalls; }
-                       set { SetProperty(ref _dialedCalls, value); }
-               }
-
-               public string datetime {
-                       get { return _datetime; }
-                       set { SetProperty(ref _datetime, value); }
-               }
-
-               public PhoneCallData () {
-               }
-       }
-
-       public class PhoneCallList : SuperViewModel {
-               private int _id;
-               private string _date;
-               private string _time;
-               private string _who;
-               private string _duration;
-
-               public int id {
-                       get { return _id; }
-                       set { SetProperty(ref _id, value); }
-               }
-
-               public string date {
-                       get { return _date; }
-                       set { SetProperty(ref _date, value); }
-               }
-
-               public string time {
-                       get { return _time; }
-                       set { SetProperty(ref _time, value); }
-               }
-
-               public string who {
-                       get { return _who; }
-                       set { SetProperty(ref _who, value); }
-               }
-
-               public string duration {
-                       get { return _duration; }
-                       set { SetProperty(ref _duration, value); }
-               }
-
-               public override string ToString() {
-                       return string.Concat(date, " ", time, " ", who, " ", duration);
-               }
-
-               public PhoneCallList () {
-               }
-       }
-}
diff --git a/SpeedportHybridControl/Model/StatusPhoneList.cs b/SpeedportHybridControl/Model/StatusPhoneList.cs
new file mode 100644 (file)
index 0000000..7b97cd4
--- /dev/null
@@ -0,0 +1,20 @@
+namespace SpeedportHybridControl.Model {
+       class StatusPhoneList : SuperViewModel {
+               private string _number;
+               private string _status;
+
+               public string number {
+                       get { return _number; }
+                       set { SetProperty(ref _number, value); }
+               }
+
+               public string status {
+                       get { return _status; }
+                       set { SetProperty(ref _status, value); }
+               }
+
+               public StatusPhoneList () {
+
+               }
+       }
+}
diff --git a/SpeedportHybridControl/Model/StatusPhoneListModel.cs b/SpeedportHybridControl/Model/StatusPhoneListModel.cs
deleted file mode 100644 (file)
index c08d448..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-namespace SpeedportHybridControl.Model {
-       class StatusPhoneListModel : SuperViewModel {
-               private string _number;
-               private string _status;
-
-               public string number {
-                       get { return _number; }
-                       set { SetProperty(ref _number, value); }
-               }
-
-               public string status {
-                       get { return _status; }
-                       set { SetProperty(ref _status, value); }
-               }
-
-               public StatusPhoneListModel () {
-
-               }
-       }
-}
diff --git a/SpeedportHybridControl/Model/TR181ViewModel.cs b/SpeedportHybridControl/Model/TR181ViewModel.cs
deleted file mode 100644 (file)
index 6b119b3..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-namespace SpeedportHybridControl.Model {
-       public class TR181 : SuperViewModel {
-               private string _enable1;
-               private string _status1;
-               private string _mode;
-               private string _servername;
-               private string _severip;
-               private string _bw;
-               private string _errorinfo;
-               private string _hellostatus;
-
-               private string _lte_tunnel;
-               private string _dsl_tunnel;
-               private string _bonding;
-               private string _QueueSkbTimeOut;
-
-               private string _datetime;
-
-               private string _bypass_up_bw;
-               private string _bypass_dw_bw;
-               private string _bypass_up_rb;
-               private string _bypass_dw_rb;
-               private string _bypass_check;
-
-               public string enable1 {
-                       get { return _enable1; }
-                       set { SetProperty(ref _enable1, value); }
-               }
-               
-               public string status1 {
-                       get { return _status1; }
-                       set { SetProperty(ref _status1, value); }
-               }
-               
-               public string mode {
-                       get { return _mode; }
-                       set { SetProperty(ref _mode, value); }
-               }
-               
-               public string servername {
-                       get { return _servername; }
-                       set { SetProperty(ref _servername, value); }
-               }
-               
-               public string severip {
-                       get { return _severip; }
-                       set { SetProperty(ref _severip, value); }
-               }
-               
-               public string bw {
-                       get { return _bw; }
-                       set { SetProperty(ref _bw, value); }
-               }
-               
-               public string errorinfo {
-                       get { return _errorinfo; }
-                       set { SetProperty(ref _errorinfo, value); }
-               }
-               
-               public string hellostatus {
-                       get { return _hellostatus; }
-                       set { SetProperty(ref _hellostatus, value); }
-               }
-               
-               public string lte_tunnel {
-                       get { return _lte_tunnel; }
-                       set { SetProperty(ref _lte_tunnel, value); }
-               }
-
-               public string dsl_tunnel {
-                       get { return _dsl_tunnel; }
-                       set { SetProperty(ref _dsl_tunnel, value); }
-               }
-
-               public string bonding {
-                       get { return _bonding; }
-                       set { SetProperty(ref _bonding, value); }
-               }
-               
-               public string QueueSkbTimeOut {
-                       get { return _QueueSkbTimeOut; }
-                       set { SetProperty(ref _QueueSkbTimeOut, value); }
-               }
-
-               public string datetime {
-                       get { return _datetime; }
-                       set { SetProperty(ref _datetime, value); }
-               }
-
-               public string bypass_up_bw {
-                       get { return _bypass_up_bw; }
-                       set { SetProperty(ref _bypass_up_bw, value); }
-               }
-
-               public string bypass_dw_bw {
-                       get { return _bypass_dw_bw; }
-                       set { SetProperty(ref _bypass_dw_bw, value); }
-               }
-
-               public string bypass_up_rb {
-                       get { return _bypass_up_rb; }
-                       set { SetProperty(ref _bypass_up_rb, value); }
-               }
-
-               public string bypass_dw_rb {
-                       get { return _bypass_dw_rb; }
-                       set { SetProperty(ref _bypass_dw_rb, value); }
-               }
-
-               public string bypass_check {
-                       get { return _bypass_check; }
-                       set { SetProperty(ref _bypass_check, value); }
-               }
-
-               public TR181() {
-               }
-       }
-}
diff --git a/SpeedportHybridControl/PageModel/PhonePageModel.cs b/SpeedportHybridControl/PageModel/PhonePageModel.cs
new file mode 100644 (file)
index 0000000..e7b5a66
--- /dev/null
@@ -0,0 +1,79 @@
+using System;
+using System.Collections.Generic;
+using SpeedportHybridControl.Model;
+using SpeedportHybridControl.Data;
+using SpeedportHybridControl.Implementations;
+using System.Threading;
+using System.Windows;
+
+namespace SpeedportHybridControl.PageModel {
+       class PhonePageModel : SuperViewModel {
+               private DelegateCommand _reloadCommand;
+               private DelegateCommand _copyCommand;
+               private DelegateCommand _clearCommand;
+               private PhoneCallList _selectedItem;
+
+               private List<PhoneCallList> _missedCalls;
+               private List<PhoneCallList> _takenCalls;
+               private List<PhoneCallList> _dialedCalls;
+               private string _datetime;
+
+               public DelegateCommand ReloadCommand {
+                       get { return _reloadCommand; }
+                       set { SetProperty(ref _reloadCommand, value); }
+               }
+
+               public DelegateCommand CopyCommand {
+                       get { return _copyCommand; }
+                       set { SetProperty(ref _copyCommand, value); }
+               }
+
+               public DelegateCommand ClearCommand {
+                       get { return _clearCommand; }
+                       set { SetProperty(ref _clearCommand, value); }
+               }
+
+               public PhoneCallList SelectedItem {
+                       get { return _selectedItem; }
+                       set { SetProperty(ref _selectedItem, value); }
+               }
+
+               public List<PhoneCallList> missedCalls {
+                       get { return _missedCalls; }
+                       set { SetProperty(ref _missedCalls, value); }
+               }
+
+               public List<PhoneCallList> takenCalls {
+                       get { return _takenCalls; }
+                       set { SetProperty(ref _takenCalls, value); }
+               }
+
+               public List<PhoneCallList> dialedCalls {
+                       get { return _dialedCalls; }
+                       set { SetProperty(ref _dialedCalls, value); }
+               }
+
+               public string datetime {
+                       get { return _datetime; }
+                       set { SetProperty(ref _datetime, value); }
+               }
+
+               private void OnReloadCommandExecute () {
+                       new Thread(() => { SpeedportHybrid.initPhone(); }).Start();
+               }
+
+               private void OnCopyCommandExecute () {
+                       Clipboard.SetText(SelectedItem.ToString());
+               }
+
+               private void OnClearCommandExecute () {
+                       //TODO
+               }
+
+               public PhonePageModel () {
+                       ReloadCommand = new DelegateCommand(new Action(OnReloadCommandExecute));
+                       CopyCommand = new DelegateCommand(new Action(OnCopyCommandExecute));
+                       ClearCommand = new DelegateCommand(new Action(OnClearCommandExecute));
+               }
+       }
+}
index 1432a456bc58e79a39b5108c959d1e86d2d5a3ca..a370ad484884e2571a68d612a600253c50a0ee1b 100644 (file)
@@ -19,7 +19,7 @@ namespace SpeedportHybridControl.PageModel {
                private string _status;
                private string _dsl_downstream;
                private string _dsl_upstream;
-               private List<StatusPhoneListModel> _addphonenumber;
+               private List<StatusPhoneList> _addphonenumber;
                private string _use_dect;
                private string _dect_devices;
                private string _wlan_ssid;
@@ -96,7 +96,7 @@ namespace SpeedportHybridControl.PageModel {
                        set { SetProperty(ref _dsl_upstream, value); }
                }
 
-               public List<StatusPhoneListModel> addphonenumber {
+               public List<StatusPhoneList> addphonenumber {
                        get { return _addphonenumber; }
                        set { SetProperty(ref _addphonenumber, value); }
                }
index c223a0918ab7013e169377f182b716c19770650b..0239332ddde9241074c85da207e2e221b5171b62 100644 (file)
@@ -67,9 +67,7 @@ namespace SpeedportHybridControl.PageModel {
                }
 
                private void OnReloadCommandExecute () {
-                       new Thread(() => {
-                               SpeedportHybrid.initSyslog();
-                       }).Start();
+                       new Thread(() => { SpeedportHybrid.initSyslog(); }).Start();
                }
 
                private void OnCopyCommandExecute () {
@@ -86,7 +84,10 @@ namespace SpeedportHybridControl.PageModel {
                }
 
                private void ApplyFilter () {
-                       if (object.ReferenceEquals(syslogList, null).Equals(false)) {
+                       if (object.ReferenceEquals(syslogList, null)) {
+                               filteredList = syslogList;
+                       }
+                       else {
                                List<SyslogList> tmp = syslogList;
                                filteredList = tmp.Where(item => SyslogFilter(item)).ToList();
                        }
@@ -94,8 +95,7 @@ namespace SpeedportHybridControl.PageModel {
 
                private bool SyslogFilter (object item) {
                        if (SearchText.IsNullOrEmpty().Equals(false)) {
-                               bool a = ((item as SyslogList).message.IndexOf(SearchText, StringComparison.OrdinalIgnoreCase) >= 0);
-                return a;
+                               return ((item as SyslogList).message.IndexOf(SearchText, StringComparison.OrdinalIgnoreCase) >= 0);
                        }
 
                        return true;
diff --git a/SpeedportHybridControl/PageModel/TR181PageModel.cs b/SpeedportHybridControl/PageModel/TR181PageModel.cs
new file mode 100644 (file)
index 0000000..151203c
--- /dev/null
@@ -0,0 +1,148 @@
+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;
+using System.Threading;
+
+namespace SpeedportHybridControl.PageModel {
+       class TR181PageModel : SuperViewModel {
+               private DelegateCommand _reloadCommand;
+               private DelegateCommand _saveCommand;
+
+               private string _enable1;
+               private string _status1;
+               private string _mode;
+               private string _servername;
+               private string _severip;
+               private string _bw;
+               private string _errorinfo;
+               private string _hellostatus;
+               private string _lte_tunnel;
+               private string _dsl_tunnel;
+               private string _bonding;
+               private string _QueueSkbTimeOut;
+               private string _datetime;
+               private string _bypass_up_bw;
+               private string _bypass_dw_bw;
+               private string _bypass_up_rb;
+               private string _bypass_dw_rb;
+               private string _bypass_check;
+
+               public DelegateCommand ReloadCommand {
+                       get { return _reloadCommand; }
+                       set { SetProperty(ref _reloadCommand, value); }
+               }
+
+               public DelegateCommand SaveCommand {
+                       get { return _saveCommand; }
+                       set { SetProperty(ref _saveCommand, value); }
+               }
+
+               public string enable1 {
+                       get { return _enable1; }
+                       set { SetProperty(ref _enable1, value); }
+               }
+
+               public string status1 {
+                       get { return _status1; }
+                       set { SetProperty(ref _status1, value); }
+               }
+
+               public string mode {
+                       get { return _mode; }
+                       set { SetProperty(ref _mode, value); }
+               }
+
+               public string servername {
+                       get { return _servername; }
+                       set { SetProperty(ref _servername, value); }
+               }
+
+               public string severip {
+                       get { return _severip; }
+                       set { SetProperty(ref _severip, value); }
+               }
+
+               public string bw {
+                       get { return _bw; }
+                       set { SetProperty(ref _bw, value); }
+               }
+
+               public string errorinfo {
+                       get { return _errorinfo; }
+                       set { SetProperty(ref _errorinfo, value); }
+               }
+
+               public string hellostatus {
+                       get { return _hellostatus; }
+                       set { SetProperty(ref _hellostatus, value); }
+               }
+
+               public string lte_tunnel {
+                       get { return _lte_tunnel; }
+                       set { SetProperty(ref _lte_tunnel, value); }
+               }
+
+               public string dsl_tunnel {
+                       get { return _dsl_tunnel; }
+                       set { SetProperty(ref _dsl_tunnel, value); }
+               }
+
+               public string bonding {
+                       get { return _bonding; }
+                       set { SetProperty(ref _bonding, value); }
+               }
+
+               public string QueueSkbTimeOut {
+                       get { return _QueueSkbTimeOut; }
+                       set { SetProperty(ref _QueueSkbTimeOut, value); }
+               }
+
+               public string datetime {
+                       get { return _datetime; }
+                       set { SetProperty(ref _datetime, value); }
+               }
+
+               public string bypass_up_bw {
+                       get { return _bypass_up_bw; }
+                       set { SetProperty(ref _bypass_up_bw, value); }
+               }
+
+               public string bypass_dw_bw {
+                       get { return _bypass_dw_bw; }
+                       set { SetProperty(ref _bypass_dw_bw, value); }
+               }
+
+               public string bypass_up_rb {
+                       get { return _bypass_up_rb; }
+                       set { SetProperty(ref _bypass_up_rb, value); }
+               }
+
+               public string bypass_dw_rb {
+                       get { return _bypass_dw_rb; }
+                       set { SetProperty(ref _bypass_dw_rb, value); }
+               }
+
+               public string bypass_check {
+                       get { return _bypass_check; }
+                       set { SetProperty(ref _bypass_check, value); }
+               }
+
+               private void OnReloadCommandExecute () {
+                       new Thread(() => { SpeedportHybrid.initTR181(); }).Start();
+               }
+
+               private void OnSaveCommandExecute () {
+                       SpeedportHybridAPI.getInstance().setQueueSkbTimeOut(QueueSkbTimeOut);
+               }
+
+               public TR181PageModel () {
+                       ReloadCommand = new DelegateCommand(new Action(OnReloadCommandExecute));
+                       SaveCommand = new DelegateCommand(new Action(OnSaveCommandExecute));
+               }
+       }
+}
index 40fee76310d34730ffe93dab3be01366e4f210fb..4ae83d9027d09e88b8d51f596f949e07bafe4797 100644 (file)
     <Compile Include="Model\Connection.cs" />
     <Compile Include="Model\DeviceViewModel.cs" />
     <Compile Include="Model\Line.cs" />
-    <Compile Include="Model\StatusPhoneListModel.cs" />
+    <Compile Include="Model\PhoneCallList.cs" />
+    <Compile Include="Model\StatusPhoneList.cs" />
     <Compile Include="Model\SyslogList.cs" />
     <Compile Include="PageModel\DslPageModel.cs" />
     <Compile Include="PageModel\LoginPageModel.cs" />
     <Compile Include="PageModel\LteInfoModel.cs" />
     <Compile Include="PageModel\MainWindowModel.cs" />
-    <Compile Include="Model\PhoneCallViewModel.cs" />
     <Compile Include="Model\SuperViewModel.cs" />
     <Compile Include="Data\SpeedportHybridAPI.cs" />
     <Page Include="ltepopup.xaml">
     </Page>
   </ItemGroup>
   <ItemGroup>
-    <Compile Include="Model\TR181ViewModel.cs" />
     <Compile Include="PageModel\OverviewPageModel.cs" />
+    <Compile Include="PageModel\PhonePageModel.cs" />
     <Compile Include="PageModel\StatusPageModel.cs" />
     <Compile Include="PageModel\SyslogPageModel.cs" />
+    <Compile Include="PageModel\TR181PageModel.cs" />
     <Compile Include="page\AboutPage.xaml.cs">
       <DependentUpon>AboutPage.xaml</DependentUpon>
     </Compile>
index 2df80487b4c67d9eaa35295b1452221fa79ff106..a6f6b62fd71aa82fbf478202f15520252d918a49 100644 (file)
@@ -1,25 +1,20 @@
 <Page x:Class="SpeedportHybridControl.page.PhonePage"
       xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
       xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
-      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
       xmlns:local="clr-namespace:SpeedportHybridControl"
-      mc:Ignorable="d" 
+      mc:Ignorable="d"
       Width="Auto" Height="Auto"
       Title="PhonePage">
-    <Page.CommandBindings>
-        <CommandBinding
-        Command="ApplicationCommands.Copy"
-        Executed="CommandBinding_Executed"/>
-    </Page.CommandBindings>
-    <Grid DataContext="{StaticResource PhoneCallData}">
+    <Grid DataContext="{StaticResource PhonePageModel}">
         <TabControl Margin="0,0,0,39">
             <TabItem Header="Verpasste Anrufe">
                 <Grid>
-                    <ListView ItemsSource="{Binding missedCalls}" x:Name="listView1">
+                    <ListView ItemsSource="{Binding missedCalls}" SelectedItem="{Binding Path=SelectedItem, UpdateSourceTrigger=PropertyChanged}" x:Name="listView1">
                         <ListView.ContextMenu>
                             <ContextMenu>
-                                <MenuItem Header="Copy" Command="ApplicationCommands.Copy"/>
+                                <MenuItem Header="Copy" Command="{Binding Path=CopyCommand, NotifyOnTargetUpdated=True}"/>
                             </ContextMenu>
                         </ListView.ContextMenu>
                         <ListView.Resources>
             </TabItem>
             <TabItem Header="Angenommene Anrufe">
                 <Grid>
-                    <ListView ItemsSource="{Binding takenCalls}" x:Name="listView2">
+                    <ListView ItemsSource="{Binding takenCalls}" SelectedItem="{Binding Path=SelectedItem, UpdateSourceTrigger=PropertyChanged}" x:Name="listView2">
                         <ListView.ContextMenu>
                             <ContextMenu>
-                                <MenuItem Header="Copy" Command="ApplicationCommands.Copy"/>
+                                <MenuItem Header="Copy" Command="{Binding Path=CopyCommand, NotifyOnTargetUpdated=True}"/>
                             </ContextMenu>
                         </ListView.ContextMenu>
                         <ListView.Resources>
             </TabItem>
             <TabItem Header="Gewählte Rufnummern">
                 <Grid>
-                    <ListView ItemsSource="{Binding dialedCalls}" x:Name="listView3">
+                    <ListView ItemsSource="{Binding dialedCalls}" SelectedItem="{Binding Path=SelectedItem, UpdateSourceTrigger=PropertyChanged}" x:Name="listView3">
                         <ListView.ContextMenu>
                             <ContextMenu>
-                                <MenuItem Header="Copy" Command="ApplicationCommands.Copy"/>
+                                <MenuItem Header="Copy" Command="{Binding Path=CopyCommand, NotifyOnTargetUpdated=True}"/>
                             </ContextMenu>
                         </ListView.ContextMenu>
                         <ListView.Resources>
@@ -87,8 +82,8 @@
             </TabItem>
         </TabControl>
         <TextBlock Text="{Binding datetime}" Margin="0,0,10,0" HorizontalAlignment="Right" VerticalAlignment="Bottom" />
-        
-        <Button x:Name="btnClear" Content="Leeren" Click="button_click" VerticalAlignment="Bottom" HorizontalAlignment="Left" Width="72" Visibility="Collapsed"/>
-        <Button x:Name="reload" Content="Aktualisieren" Margin="218,0,218,0" VerticalAlignment="Bottom" Click="button_click" />
+
+        <Button Command="{Binding Path=ClearCommand}" x:Name="btnClear" Content="Leeren" VerticalAlignment="Bottom" HorizontalAlignment="Left" Width="72" Visibility="Collapsed"/>
+        <Button Command="{Binding Path=ReloadCommand}" x:Name="reload" Content="Aktualisieren" Margin="218,0,218,0" VerticalAlignment="Bottom" />
     </Grid>
 </Page>
index 8b71cb55a8e69df5b2016e0b2ecf9a90091c195b..e0501e9d1690d2989fe94c3e96c5f55eb9c03b0a 100644 (file)
@@ -1,5 +1,4 @@
-using System.Windows;
-using System.Windows.Controls;
+using System.Windows.Controls;
 
 namespace SpeedportHybridControl.page {
        /// <summary>
@@ -9,27 +8,5 @@ namespace SpeedportHybridControl.page {
                public PhonePage() {
                        InitializeComponent();
                }
-
-               private void CommandBinding_Executed(object sender, RoutedEventArgs e) {
-                       string text = string.Empty;
-
-                       if (e.Source.Equals(listView1)) {
-                               text = listView1.SelectedItem.ToString();
-                       }
-                       else if (e.Source.Equals(listView2)) {
-                               text = listView2.SelectedItem.ToString();
-                       }
-                       else if (e.Source.Equals(listView3)) {
-                               text = listView3.SelectedItem.ToString();
-                       }
-                       Clipboard.SetText(text);
-                       text = null;
-               }
-
-               private void button_click(object sender, RoutedEventArgs e) {
-                       if (sender.Equals(reload)) {
-                               //util.init("Phone");
-                       }
-               }
        }
 }
index 2ace5cc2451c6934e1ff7f08fb427c840fddd7f2..2c3fa524efe6262d3d2abca8be64f40fd274b512 100644 (file)
@@ -1,8 +1,8 @@
 <Page x:Class="SpeedportHybridControl.page.SyslogPage"
       xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
       xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
-      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
       xmlns:local="clr-namespace:SpeedportHybridControl"
       mc:Ignorable="d"
       Width="Auto" Height="Auto"
index 68a15fc24b425ba2055cc45adf45bee764dffa3e..9aa2e7eb231764a10e76a689074076fcf9088add 100644 (file)
@@ -1,14 +1,14 @@
 <Page x:Class="SpeedportHybridControl.page.TR181Page"
       xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
       xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
-      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
       xmlns:local="clr-namespace:SpeedportHybridControl"
-      mc:Ignorable="d" 
+      mc:Ignorable="d"
       Width="Auto" Height="Auto"
       Title="TR181Page">
 
-    <Grid DataContext="{StaticResource TR181}">
+    <Grid DataContext="{StaticResource TR181PageModel}">
         <GroupBox Header="TR181 Parameter" HorizontalAlignment="Left" VerticalAlignment="Top">
             <Grid>
                 <StackPanel Margin="0,0,20,0">
@@ -53,7 +53,7 @@
             <Grid>
                 <TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="QueueSkbTimeOut:" VerticalAlignment="Top" Margin="0,3,0,0"/>
                 <TextBox x:Name="tbQueue" HorizontalAlignment="Left" Margin="115,2,0,0" TextWrapping="Wrap" Text="{Binding QueueSkbTimeOut}" VerticalAlignment="Top" Width="42" />
-                <Button x:Name="btnSave" Content="Speichern" HorizontalAlignment="Left" Margin="44,34,0,0" VerticalAlignment="Top" Width="75" Click="button_click" />
+                <Button Command="{Binding Path=SaveCommand}" x:Name="btnSave" Content="Speichern" HorizontalAlignment="Left" Margin="44,34,0,0" VerticalAlignment="Top" Width="75" />
             </Grid>
         </GroupBox>
         <GroupBox Header="BYPASS Info" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,151,0,0" Width="208">
@@ -76,6 +76,6 @@
         </GroupBox>
 
         <TextBlock Text="{Binding datetime}" Margin="0,0,10,0" HorizontalAlignment="Right" VerticalAlignment="Bottom" />
-        <Button x:Name="reload" Content="Aktualisieren" Margin="218,0,218,0" VerticalAlignment="Bottom" Click="button_click" />
+        <Button Command="{Binding Path=ReloadCommand}" x:Name="reload" Content="Aktualisieren" Margin="218,0,218,0" VerticalAlignment="Bottom"/>
     </Grid>
 </Page>
index 6107d36601ca691c6297273b630a1492cdbe90a9..d57b7efb4da29b4f51b49e658470bdf3dd5991cb 100644 (file)
@@ -1,5 +1,4 @@
-using System.Windows;
-using System.Windows.Controls;
+using System.Windows.Controls;
 
 namespace SpeedportHybridControl.page {
        /// <summary>
@@ -9,14 +8,5 @@ namespace SpeedportHybridControl.page {
                public TR181Page() {
                        InitializeComponent();
                }
-
-               private void button_click(object sender, RoutedEventArgs e) {
-                       if (sender.Equals(reload)) {
-                               //util.init("TR181");
-                       }
-                       else if (sender.Equals(btnSave)) {
-                               //SpeedportHybridAPI.getInstance().setQueueSkbTimeOut(tbQueue.Text);
-                       }
-               }
        }
 }