<pagemodel:SyslogPageModel x:Key="SyslogPageModel"></pagemodel:SyslogPageModel>
<pagemodel:TR181PageModel x:Key="TR181PageModel"></pagemodel:TR181PageModel>
<pagemodel:PhonePageModel x:Key="PhonePageModel"></pagemodel:PhonePageModel>
-
- <model:DeviceData x:Key="DeviceData"></model:DeviceData>
+ <pagemodel:LanPageModel x:Key="LanPageModel"></pagemodel:LanPageModel>
</ResourceDictionary>
</Application.Resources>
</Application>
--- /dev/null
+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() {
+ }
+ }
+}
+++ /dev/null
-using System.Collections.Generic;
-
-namespace SpeedportHybridControl.Model {
- public class DeviceData : SuperViewModel {
- private List<DeviceList> _deviceList;
- private string _datetime;
-
- public List<DeviceList> 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() {
- }
- }
-}
--- /dev/null
+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> _deviceList;
+ private string _datetime;
+
+ public DelegateCommand ReloadCommand {
+ get { return _reloadCommand; }
+ set { SetProperty(ref _reloadCommand, value); }
+ }
+
+ public List<DeviceList> 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));
+ }
+ }
+}
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;
</Compile>
<Compile Include="Model\bonding_client.cs" />
<Compile Include="Model\Connection.cs" />
- <Compile Include="Model\DeviceViewModel.cs" />
+ <Compile Include="Model\DeviceList.cs" />
<Compile Include="Model\Line.cs" />
<Compile Include="Model\PhoneCallList.cs" />
<Compile Include="Model\StatusPhoneList.cs" />
<Compile Include="Model\SyslogList.cs" />
<Compile Include="PageModel\DslPageModel.cs" />
+ <Compile Include="PageModel\LanPageModel.cs" />
<Compile Include="PageModel\LoginPageModel.cs" />
<Compile Include="PageModel\LteInfoModel.cs" />
<Compile Include="PageModel\MainWindowModel.cs" />
<Page x:Class="SpeedportHybridControl.page.LanPage"
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="LanPage">
- <Grid DataContext="{StaticResource DeviceData}">
+ <Grid DataContext="{StaticResource LanPageModel}">
<ListView ItemsSource="{Binding deviceList}" x:Name="listView4" Margin="0,0,0,39">
<ListView.Resources>
<Style TargetType="{x:Type GridViewColumnHeader}">
<TextBlock Text="{Binding datetime}" Margin="0,0,10,0" HorizontalAlignment="Right" VerticalAlignment="Bottom" />
- <Button x:Name="reload" Content="Aktualisieren" Margin="218,0,218,0" Click="button_click" VerticalAlignment="Bottom"/>
+ <Button Command="{Binding Path=ReloadCommand}" x:Name="reload" Content="Aktualisieren" Margin="218,0,218,0" VerticalAlignment="Bottom"/>
</Grid>
</Page>