2025-07-17 17:27:16 +08:00
|
|
|
using CommunityToolkit.Mvvm.ComponentModel;
|
|
|
|
|
using CommunityToolkit.Mvvm.Input;
|
|
|
|
|
using System.Collections.ObjectModel;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
2025-07-26 10:05:43 +08:00
|
|
|
using DMS.WPF.ViewModels.Items;
|
2025-07-17 17:27:16 +08:00
|
|
|
|
2025-07-19 11:11:01 +08:00
|
|
|
namespace DMS.WPF.ViewModels.Dialogs;
|
2025-07-17 17:27:16 +08:00
|
|
|
|
|
|
|
|
public partial class MqttAliasBatchEditDialogViewModel : ObservableObject
|
|
|
|
|
{
|
|
|
|
|
[ObservableProperty]
|
|
|
|
|
private string _title = "批量设置MQTT别名";
|
|
|
|
|
|
|
|
|
|
[ObservableProperty]
|
2025-07-26 10:05:43 +08:00
|
|
|
private ObservableCollection<VariableMqttAlias> _variablesToEdit;
|
2025-07-17 17:27:16 +08:00
|
|
|
|
2025-07-26 10:05:43 +08:00
|
|
|
public MqttServerItemViewModel SelectedMqtt { get; private set; }
|
2025-07-17 17:27:16 +08:00
|
|
|
|
2025-07-26 10:05:43 +08:00
|
|
|
public MqttAliasBatchEditDialogViewModel(List<VariableItemViewModel> selectedVariables, MqttServerItemViewModel selectedMqtt)
|
2025-07-17 17:27:16 +08:00
|
|
|
{
|
|
|
|
|
SelectedMqtt = selectedMqtt;
|
2025-07-26 10:05:43 +08:00
|
|
|
Title=$"设置:{SelectedMqtt.ServerName}-MQTT服务器关联变量的别名";
|
|
|
|
|
// VariablesToEdit = new ObservableCollection<VariableMqttAlias>(
|
|
|
|
|
// selectedVariables.Select(v => new VariableMqttAlias(v, selectedMqtt))
|
|
|
|
|
// );
|
2025-07-17 17:27:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public MqttAliasBatchEditDialogViewModel()
|
|
|
|
|
{
|
|
|
|
|
// For design time
|
2025-07-26 10:05:43 +08:00
|
|
|
// VariablesToEdit = new ObservableCollection<VariableMqtt>();
|
2025-07-17 17:27:16 +08:00
|
|
|
}
|
|
|
|
|
}
|