Files
DMS/DMS.WPF/ViewModels/Dialogs/DeviceDialogViewModel.cs

37 lines
907 B
C#
Raw Normal View History

using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using DMS.Models;
using S7.Net; // AddAsync this using directive
namespace DMS.ViewModels.Dialogs;
public partial class DeviceDialogViewModel : ObservableObject
{
[ObservableProperty]
private Device _device;
partial void OnDeviceChanged(Device value)
{
if (value != null)
{
System.Diagnostics.Debug.WriteLine($"Device ProtocolType changed to: {value.ProtocolType}");
}
}
2025-07-01 21:34:20 +08:00
[ObservableProperty] private string title ;
[ObservableProperty] private string primaryButContent ;
public DeviceDialogViewModel(Device device)
{
_device = device;
}
// AddAsync a property to expose CpuType enum values for ComboBox
public Array CpuTypes => Enum.GetValues(typeof(CpuType));
[RelayCommand]
public void AddDevice()
{
}
}