mirror of
https://github.com/OpenLogics/MewtocolNet.git
synced 2025-12-06 03:01:24 +00:00
Move examples from root to /Examples
This commit is contained in:
36
Examples/Examples.WPF/ViewModels/PlcDataViewViewModel.cs
Normal file
36
Examples/Examples.WPF/ViewModels/PlcDataViewViewModel.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using Examples.WPF.RegisterCollections;
|
||||
using MewtocolNet;
|
||||
using MewtocolNet.Events;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Examples.WPF.ViewModels;
|
||||
|
||||
public class PlcDataViewViewModel : ViewModelBase {
|
||||
|
||||
private ReconnectArgs plcCurrentReconnectArgs = null!;
|
||||
|
||||
public IPlc Plc => App.ViewModel.Plc!;
|
||||
|
||||
public TestRegisterCollection RegCollection => App.ViewModel.TestRegCollection;
|
||||
|
||||
public ReconnectArgs PlcCurrentReconnectArgs {
|
||||
get => plcCurrentReconnectArgs;
|
||||
set {
|
||||
plcCurrentReconnectArgs = value;
|
||||
OnPropChange();
|
||||
}
|
||||
}
|
||||
|
||||
public PlcDataViewViewModel () {
|
||||
|
||||
Plc.ReconnectTryStarted += (s, e) => PlcCurrentReconnectArgs = e;
|
||||
Plc.Reconnected += (s, e) => PlcCurrentReconnectArgs = null!;
|
||||
Plc.Disconnected += (s, e) => PlcCurrentReconnectArgs = null!;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user