Files
infineon_cs_hmi/uniper_hmi/UniperHMI/Pages/ViewModels/NIOStationPageVM.cs

46 lines
1.0 KiB
C#

using CommunityToolkit.Mvvm.ComponentModel;
using HMIToolkit;
using System.ComponentModel.DataAnnotations;
using Heisig.HMI.AdsManager;
using CommunityToolkit.Mvvm.Input;
using TwinCAT.TypeSystem;
using System.Collections.ObjectModel;
using UniperHMI.Model;
namespace UniperHMI
{
public sealed partial class NIOStationPageVM : ObservableValidator, IDisposable
{
private readonly string? _variableName;
private readonly IAdsManager? _adsManager;
[ObservableProperty]
private BinaryValveControlVM cylinderNIOPlateVM;
public NIOStationPageVM()
{
cylinderNIOPlateVM = new BinaryValveControlVM();
}
public NIOStationPageVM(IAdsManager adsManager, string variableName)
{
_adsManager = adsManager;
_variableName = variableName;
cylinderNIOPlateVM = new BinaryValveControlVM(_adsManager, _variableName);
}
public void Dispose()
{
CylinderNIOPlateVM?.Dispose();
}
}
}