<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>
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;
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;
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) {
pstatus = "Nicht aktiv";
}
- statusPhoneList.Add(new StatusPhoneListModel() { number = pnumber, status = pstatus });
+ statusPhoneList.Add(new StatusPhoneList() { number = pnumber, status = pstatus });
}
}
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>();
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();
--- /dev/null
+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 () {
+ }
+ }
+}
+++ /dev/null
-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 () {
- }
- }
-}
--- /dev/null
+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 () {
+
+ }
+ }
+}
+++ /dev/null
-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 () {
-
- }
- }
-}
+++ /dev/null
-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() {
- }
- }
-}
--- /dev/null
+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));
+ }
+ }
+}
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;
set { SetProperty(ref _dsl_upstream, value); }
}
- public List<StatusPhoneListModel> addphonenumber {
+ public List<StatusPhoneList> addphonenumber {
get { return _addphonenumber; }
set { SetProperty(ref _addphonenumber, value); }
}
}
private void OnReloadCommandExecute () {
- new Thread(() => {
- SpeedportHybrid.initSyslog();
- }).Start();
+ new Thread(() => { SpeedportHybrid.initSyslog(); }).Start();
}
private void OnCopyCommandExecute () {
}
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();
}
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;
--- /dev/null
+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));
+ }
+ }
+}
<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>
<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>
</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>
-using System.Windows;
-using System.Windows.Controls;
+using System.Windows.Controls;
namespace SpeedportHybridControl.page {
/// <summary>
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");
- }
- }
}
}
<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"
<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">
<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">
</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>
-using System.Windows;
-using System.Windows.Controls;
+using System.Windows.Controls;
namespace SpeedportHybridControl.page {
/// <summary>
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);
- }
- }
}
}