From 4159e95bf32bcfedd033701ce0e8c963890ab0c4 Mon Sep 17 00:00:00 2001 From: "David P.G" Date: Thu, 3 Jul 2025 12:55:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E6=B7=BB=E5=8A=A0=E5=8F=98?= =?UTF-8?q?=E9=87=8F=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Data/Entities/DbDevice.cs | 3 +- Data/Entities/DbVariableData.cs | 122 +++++++++++++++---- Data/Repositories/DeviceRepository.cs | 37 +++--- Data/Repositories/VarDataRepository.cs | 79 ++++++++++++ Data/Repositories/VariableTableRepository.cs | 53 -------- Extensions/ObjectExtensions.cs | 2 +- Helper/NotificationHelper.cs | 1 + Models/VariableData.cs | 112 ++++++++++++++--- Services/DialogService.cs | 18 ++- Services/IDialogService.cs | 4 +- ViewModels/Dialogs/VarDataDialogViewModel.cs | 14 +++ ViewModels/MainViewModel.cs | 3 +- ViewModels/VariableTableViewModel.cs | 61 ++++++++-- Views/Dialogs/VarDataDialog.xaml | 119 ++++++++++++++++++ Views/Dialogs/VarDataDialog.xaml.cs | 17 +++ Views/VariableTableView.xaml | 7 +- 16 files changed, 528 insertions(+), 124 deletions(-) create mode 100644 Data/Repositories/VarDataRepository.cs delete mode 100644 Data/Repositories/VariableTableRepository.cs create mode 100644 ViewModels/Dialogs/VarDataDialogViewModel.cs create mode 100644 Views/Dialogs/VarDataDialog.xaml create mode 100644 Views/Dialogs/VarDataDialog.xaml.cs diff --git a/Data/Entities/DbDevice.cs b/Data/Entities/DbDevice.cs index 5b8b7d7..b0cff74 100644 --- a/Data/Entities/DbDevice.cs +++ b/Data/Entities/DbDevice.cs @@ -13,7 +13,8 @@ public class DbDevice public string Name { get; set; } - [SugarColumn(IsNullable = true)] public string? Description { get; set; } + [SugarColumn(IsNullable = true)] + public string? Description { get; set; } public string Ip { get; set; } public bool IsActive { get; set; } diff --git a/Data/Entities/DbVariableData.cs b/Data/Entities/DbVariableData.cs index 6da6f31..d3a7e3b 100644 --- a/Data/Entities/DbVariableData.cs +++ b/Data/Entities/DbVariableData.cs @@ -4,45 +4,123 @@ using SqlSugar.DbConvert; namespace PMSWPF.Data.Entities; -[SugarTable("VariableData")] +[SugarTable("VarData")] public class DbVariableData { + /// + /// 变量唯一标识符 + /// [SugarColumn(IsPrimaryKey = true, IsIdentity = true)] //数据库是自增才配自增 public int Id { get; set; } - [SugarColumn(IsNullable = true)] public int? VariableTableId { get; set; } + /// + /// 关联的变量表ID + /// + public int VariableTableId { get; set; } + /// + /// 关联的变量表实体 + /// [Navigate(NavigateType.ManyToOne, nameof(VariableTableId))] public DbVariableTable? VariableTable { get; set; } + /// + /// 变量名称 + /// public string Name { get; set; } - [SugarColumn(IsNullable = true)] public string? Description { get; set; } + /// + /// 变量描述 + /// + [SugarColumn(IsNullable = true)] + public string? Description { get; set; } - public string NodeId { get; set; } + /// + /// 节点ID,用于标识变量在设备或系统中的唯一路径 + /// + public string NodeId { get; set; } = String.Empty; + /// + /// 协议类型,例如Modbus、OPC UA等 + /// [SugarColumn(ColumnDataType = "varchar(20)", SqlParameterDbType = typeof(EnumToStringConvert))] public ProtocolType ProtocolType { get; set; } - public string DataType { get; set; } - - [SugarColumn(IsNullable = true)] public List? Mqtts { get; set; } - - public string DataValue { get; set; } = String.Empty; - public string DisplayValue { get; set; } = String.Empty; - public DateTime UpdateTime { get; set; } - - [SugarColumn(IsNullable = true)] public DbUser? UpdateUser { get; set; } - - public string Converstion { get; set; } = String.Empty; - public bool IsDeleted { get; set; } - public bool IsActive { get; set; } - public bool IsSave { get; set; } - public double SaveRange { get; set; } - public bool IsAlarm { get; set; } - public double AlarmMin { get; set; } - public double AlarmMax { get; set; } + /// + /// 数据类型,例如Int、Float、String等 + /// + public string DataType { get; set; }=String.Empty; + /// + /// 信号类型,例如模拟量、数字量等 + /// [SugarColumn(ColumnDataType = "varchar(20)", IsNullable = true, SqlParameterDbType = typeof(EnumToStringConvert))] public SignalType SignalType { get; set; } + + /// + /// 变量当前原始数据值 + /// + public string DataValue { get; set; } = String.Empty; + + /// + /// 变量经过转换或格式化后的显示值 + /// + public string DisplayValue { get; set; } = String.Empty; + + /// + /// 变量数据最后更新时间 + /// + public DateTime UpdateTime { get; set; } = DateTime.Now; + + /// + /// 最后更新变量数据的用户 + /// + [SugarColumn(IsNullable = true)] + public DbUser? UpdateUser { get; set; } + + /// + /// 关联的MQTT配置列表 + /// + [SugarColumn(IsNullable = true)] + public List? Mqtts { get; set; } + + /// + /// 数据转换规则或表达式 + /// + public string Converstion { get; set; } = String.Empty; + + /// + /// 指示变量是否处于激活状态 + /// + public bool IsActive { get; set; } + + /// + /// 指示是否需要保存变量数据 + /// + public bool IsSave { get; set; } + + /// + /// 数据保存的范围或阈值 + /// + public double SaveRange { get; set; } + + /// + /// 指示是否需要对变量进行报警监测 + /// + public bool IsAlarm { get; set; } + + /// + /// 报警的最小值阈值 + /// + public double AlarmMin { get; set; } + + /// + /// 报警的最大值阈值 + /// + public double AlarmMax { get; set; } + + /// + /// 指示变量是否已被逻辑删除 + /// + public bool IsDeleted { get; set; } } \ No newline at end of file diff --git a/Data/Repositories/DeviceRepository.cs b/Data/Repositories/DeviceRepository.cs index 627d3df..1c54cd8 100644 --- a/Data/Repositories/DeviceRepository.cs +++ b/Data/Repositories/DeviceRepository.cs @@ -16,18 +16,17 @@ public class DeviceRepository public DeviceRepository() { - _menuRepository=new MenuRepository(); - _varTableRepository=new VarTableRepository(); + _menuRepository = new MenuRepository(); + _varTableRepository = new VarTableRepository(); } - - public async Task Edit(Device device) { using (var db = DbContext.GetInstance()) { - return await db.Updateable(device.CopyTo()).ExecuteCommandAsync(); + return await db.Updateable(device.CopyTo()) + .ExecuteCommandAsync(); } } @@ -40,7 +39,9 @@ public class DeviceRepository { using (var db = DbContext.GetInstance()) { - var dlist = await db.Queryable().Includes(d => d.VariableTables, dv => dv.Device).ToListAsync(); + var dlist = await db.Queryable() + .Includes(d => d.VariableTables, dv => dv.Device) + .ToListAsync(); var devices = new List(); foreach (var dbDevice in dlist) { @@ -56,7 +57,8 @@ public class DeviceRepository { using (var db = DbContext.GetInstance()) { - return await db.Queryable().FirstAsync(p => p.Id == id); + return await db.Queryable() + .FirstAsync(p => p.Id == id); } } @@ -64,10 +66,11 @@ public class DeviceRepository { using (var db = DbContext.GetInstance()) { - return await db.Deleteable(new DbDevice { Id = id }).ExecuteCommandAsync(); + return await db.Deleteable(new DbDevice { Id = id }) + .ExecuteCommandAsync(); } } - + /// /// 添加设备,包括菜单 /// @@ -101,11 +104,11 @@ public class DeviceRepository if (device.IsAddDefVarTable) { var defVarTable = await _varTableRepository.AddDeviceDefVarTable(addDevice, db); - await _menuRepository.AddDeviceDefTableMenu(device, addDeviceMenuId, defVarTable.Id,db); + await _menuRepository.AddDeviceDefTableMenu(device, addDeviceMenuId, defVarTable.Id, db); } // 添加添加变量表的菜单 - await _menuRepository.AddVarTableMenu(addDevice,addDeviceMenuId, db); + await _menuRepository.AddVarTableMenu(addDevice, addDeviceMenuId, db); await db.CommitTranAsync(); // 菜单也添加成功,通知 UI 更新 MessageHelper.SendLoadMessage(LoadTypes.Menu); @@ -117,9 +120,8 @@ public class DeviceRepository await db.RollbackTranAsync(); // 捕获并记录所有未预期的异常 string errorMsg = $"在添加设备过程中发生未预期错误:"; - Logger.Error(errorMsg+e); - NotificationHelper.ShowMessage(errorMsg+e.Message, NotificationType.Error); - + Logger.Error(errorMsg + e); + NotificationHelper.ShowMessage(errorMsg + e.Message, NotificationType.Error); } } @@ -132,12 +134,15 @@ public class DeviceRepository /// private async Task Add(Device device, SqlSugarClient db) { - var exist = await db.Queryable().Where(d => d.Name == device.Name).FirstAsync(); + var exist = await db.Queryable() + .Where(d => d.Name == device.Name) + .FirstAsync(); if (exist != null) throw new InvalidOperationException("设备名称已经存在。"); var dbDevice = new DbDevice(); device.CopyTo(dbDevice); // 是否添加默认变量表 - return await db.Insertable(dbDevice).ExecuteReturnEntityAsync(); + return await db.Insertable(dbDevice) + .ExecuteReturnEntityAsync(); } } \ No newline at end of file diff --git a/Data/Repositories/VarDataRepository.cs b/Data/Repositories/VarDataRepository.cs new file mode 100644 index 0000000..afd9c61 --- /dev/null +++ b/Data/Repositories/VarDataRepository.cs @@ -0,0 +1,79 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using PMSWPF.Data.Entities; +using PMSWPF.Extensions; +using PMSWPF.Models; + +namespace PMSWPF.Data.Repositories; + +/// +/// VariableData仓储类,用于操作DbVariableData实体 +/// +public class VarDataRepository +{ + /// + /// 根据ID获取VariableData + /// + /// 主键ID + /// + public async Task GetByIdAsync(int id) + { + using (var _db = DbContext.GetInstance()) + { + return await _db.Queryable().In(id).SingleAsync(); + } + } + + /// + /// 获取所有VariableData + /// + /// + public async Task> GetAllAsync() + { + using (var _db = DbContext.GetInstance()) + { + return await _db.Queryable().Select(dbVarData => dbVarData.CopyTo()) + .ToListAsync(); + } + } + + /// + /// 新增VariableData + /// + /// VariableData实体 + /// + public async Task AddAsync(VariableData variableData) + { + using (var _db = DbContext.GetInstance()) + { + var dbVarData = await _db.Insertable(variableData.CopyTo()).ExecuteReturnEntityAsync(); + return dbVarData.CopyTo(); + } + } + + /// + /// 更新VariableData + /// + /// VariableData实体 + /// + public async Task UpdateAsync(VariableData variableData) + { + using (var _db = DbContext.GetInstance()) + { + return await _db.Updateable(variableData.CopyTo()).ExecuteCommandAsync(); + } + } + + /// + /// 根据ID删除VariableData + /// + /// 主键ID + /// + public async Task DeleteAsync(int id) + { + using (var _db = DbContext.GetInstance()) + { + return await _db.Deleteable().In(id).ExecuteCommandAsync(); + } + } +} \ No newline at end of file diff --git a/Data/Repositories/VariableTableRepository.cs b/Data/Repositories/VariableTableRepository.cs deleted file mode 100644 index 49ed04e..0000000 --- a/Data/Repositories/VariableTableRepository.cs +++ /dev/null @@ -1,53 +0,0 @@ -using PMSWPF.Data.Entities; -using PMSWPF.Extensions; -using PMSWPF.Models; -using SqlSugar; - -namespace PMSWPF.Data.Repositories; - -public class VariableTableRepository -{ - private SqlSugarClient _db; - public VariableTableRepository() - { - _db = DbContext.GetInstance(); - } - // public async Task Add(VariableTable variableTable) - // { - // var exist = await _db.Queryable().Where(d => d.Name == device.Name).FirstAsync(); - // if (exist != null) - // throw new InvalidOperationException("设备名称已经存在。"); - // var dbDevice = new DbDevice(); - // device.CopyTo(dbDevice); - // dbDevice.VariableTables = new List(); - // // 添加默认变量表 - // var dbVariableTable = new DbVariableTable(); - // dbVariableTable.Name = "默认变量表"; - // dbVariableTable.Description = "默认变量表"; - // dbVariableTable.ProtocolType = dbDevice.ProtocolType; - // dbDevice.VariableTables.Add(dbVariableTable); - // var addDbDevice= await _db.InsertNav(dbDevice).Include(d => d.VariableTables).ExecuteReturnEntityAsync(); - // return addDbDevice.CopyTo(); - // } - - public async Task> GetAll() - { - var dbVariableTables = await _db.Queryable().Includes(dv=>dv.Device).ToListAsync(); - var variableTables = new List(); - - foreach (var dbVariableTable in dbVariableTables) - variableTables.Add(dbVariableTable.CopyTo()); - - return variableTables; - } - - public async Task GetById(int id) - { - return await _db.Queryable().FirstAsync(p => p.Id == id); - } - - public async Task DeleteById(int id) - { - return await _db.Deleteable(new DbVariableTable { Id = id }).ExecuteCommandAsync(); - } -} \ No newline at end of file diff --git a/Extensions/ObjectExtensions.cs b/Extensions/ObjectExtensions.cs index e7bd383..b4aba7d 100644 --- a/Extensions/ObjectExtensions.cs +++ b/Extensions/ObjectExtensions.cs @@ -71,7 +71,7 @@ public static class ObjectExtensions targetProperty.PropertyType.GetGenericTypeDefinition() == typeof(List<>); // 场景 1: 属性类型完全相同 - if (targetProperty.PropertyType == sourceProperty.PropertyType) + if (targetProperty.PropertyType.FullName == sourceProperty.PropertyType.FullName) { targetProperty.SetValue(ttarget, sourceValue); } diff --git a/Helper/NotificationHelper.cs b/Helper/NotificationHelper.cs index 7b2efea..bc3e0e5 100644 --- a/Helper/NotificationHelper.cs +++ b/Helper/NotificationHelper.cs @@ -8,6 +8,7 @@ namespace PMSWPF.Helper; public class NotificationHelper { private static readonly ILogger Logger = LogManager.GetCurrentClassLogger(); + public static void ShowMessage(string msg, NotificationType notificationType = NotificationType.Info, bool isGlobal = false) { diff --git a/Models/VariableData.cs b/Models/VariableData.cs index f6c17f5..c057651 100644 --- a/Models/VariableData.cs +++ b/Models/VariableData.cs @@ -4,24 +4,108 @@ namespace PMSWPF.Models; public class VariableData { + /// + /// 变量唯一标识符 + /// public int Id { get; set; } + /// + /// 关联的变量表ID + /// + public int VariableTableId { get; set; } + + + /// + /// 变量名称 + /// public string Name { get; set; } - public string Description { get; set; } + + /// + /// 变量描述 + /// + public string Description { get; set; }=String.Empty; + + /// + /// 节点ID,用于标识变量在设备或系统中的唯一路径 + /// public string NodeId { get; set; } + + /// + /// 协议类型,例如Modbus、OPC UA等 + /// public ProtocolType ProtocolType { get; set; } + + /// + /// 数据类型,例如Int、Float、String等 + /// public string DataType { get; set; } - public List Mqtts { get; set; } - public string DataValue { get; set; } - public string DisplayValue { get; set; } - public DateTime UpdateTime { get; set; } - public User UpdateUser { get; set; } - public string Converstion { get; set; } - public bool IsDeleted { get; set; } - public bool IsActive { get; set; } - public bool IsSave { get; set; } - public double SaveRange { get; set; } - public bool IsAlarm { get; set; } - public double AlarmMin { get; set; } - public double AlarmMax { get; set; } + + /// + /// 信号类型,例如模拟量、数字量等 + /// public SignalType SignalType { get; set; } + + /// + /// 变量当前原始数据值 + /// + public string DataValue { get; set; }=String.Empty; + + /// + /// 变量经过转换或格式化后的显示值 + /// + public string DisplayValue { get; set; }=String.Empty; + + /// + /// 变量数据最后更新时间 + /// + public DateTime UpdateTime { get; set; }=DateTime.Now; + + /// + /// 最后更新变量数据的用户 + /// + public User UpdateUser { get; set; } + + /// + /// 关联的MQTT配置列表 + /// + public List Mqtts { get; set; } + + /// + /// 数据转换规则或表达式 + /// + public string Converstion { get; set; }=String.Empty; + + /// + /// 指示变量是否处于激活状态 + /// + public bool IsActive { get; set; } + + /// + /// 指示是否需要保存变量数据 + /// + public bool IsSave { get; set; } + + /// + /// 数据保存的范围或阈值 + /// + public double SaveRange { get; set; } + + /// + /// 指示是否需要对变量进行报警监测 + /// + public bool IsAlarm { get; set; } + + /// + /// 报警的最小值阈值 + /// + public double AlarmMin { get; set; } + + /// + /// 报警的最大值阈值 + /// + public double AlarmMax { get; set; } + + /// + /// 指示变量是否已被逻辑删除 + /// + public bool IsDeleted { get; set; } } \ No newline at end of file diff --git a/Services/DialogService.cs b/Services/DialogService.cs index 2640327..38ce135 100644 --- a/Services/DialogService.cs +++ b/Services/DialogService.cs @@ -1,4 +1,5 @@ using iNKORE.UI.WPF.Modern.Controls; +using NPOI.SS.Formula.Functions; using PMSWPF.Models; using PMSWPF.ViewModels.Dialogs; using PMSWPF.Views.Dialogs; @@ -56,7 +57,7 @@ public class DialogService :IDialogService return false; } - public async Task ShowAddVarTableDialog(Device device) + public async Task ShowAddVarTableDialog() { VarTableDialogViewModel vm = new(); vm.Title = "添加变量表"; @@ -70,6 +71,21 @@ public class DialogService :IDialogService } return null; } + + public async Task ShowAddVarDataDialog() + { + VarDataDialogViewModel vm = new(); + vm.Title = "添加变量"; + vm.PrimaryButtonText = "添加变量"; + vm.VariableData = new VariableData(); + var dialog = new VarDataDialog(vm); + var res = await dialog.ShowAsync(); + if (res == ContentDialogResult.Primary) + { + return vm.VariableData; + } + return null; + } public void ShowMessageDialog(string title, string message) diff --git a/Services/IDialogService.cs b/Services/IDialogService.cs index cfaea5c..c352a0c 100644 --- a/Services/IDialogService.cs +++ b/Services/IDialogService.cs @@ -9,7 +9,9 @@ public interface IDialogService Task ShowConfrimeDialog(string title, string message,string buttonText="确认"); - Task ShowAddVarTableDialog(Device device); + Task ShowAddVarTableDialog(); + + Task ShowAddVarDataDialog(); void ShowMessageDialog(string title, string message); } \ No newline at end of file diff --git a/ViewModels/Dialogs/VarDataDialogViewModel.cs b/ViewModels/Dialogs/VarDataDialogViewModel.cs new file mode 100644 index 0000000..977b855 --- /dev/null +++ b/ViewModels/Dialogs/VarDataDialogViewModel.cs @@ -0,0 +1,14 @@ +using CommunityToolkit.Mvvm.ComponentModel; +using PMSWPF.Models; + +namespace PMSWPF.ViewModels.Dialogs; + +public partial class VarDataDialogViewModel : ObservableObject +{ + [ObservableProperty] + private VariableData variableData; + [ObservableProperty] + private string title; + [ObservableProperty] + private string primaryButtonText; +} \ No newline at end of file diff --git a/ViewModels/MainViewModel.cs b/ViewModels/MainViewModel.cs index 8bbe789..206e4a1 100644 --- a/ViewModels/MainViewModel.cs +++ b/ViewModels/MainViewModel.cs @@ -116,9 +116,10 @@ public partial class MainViewModel : ViewModelBase NotificationHelper.ShowMessage("操作失败:无法获取有效的设备信息。", NotificationType.Error); return; } + // 2. 显示添加变量表对话框 - var varTable = await _dialogService.ShowAddVarTableDialog(device); + var varTable = await _dialogService.ShowAddVarTableDialog(); if (varTable == null) { // 用户取消或未选择 diff --git a/ViewModels/VariableTableViewModel.cs b/ViewModels/VariableTableViewModel.cs index 8af44ad..0c90047 100644 --- a/ViewModels/VariableTableViewModel.cs +++ b/ViewModels/VariableTableViewModel.cs @@ -1,18 +1,28 @@ using System.Collections.ObjectModel; using CommunityToolkit.Mvvm.ComponentModel; -using Microsoft.Extensions.Logging; +using CommunityToolkit.Mvvm.Input; +using NLog; using PMSWPF.Data.Repositories; using PMSWPF.Enums; using PMSWPF.Helper; using PMSWPF.Models; +using PMSWPF.Services; +using ILogger = Microsoft.Extensions.Logging.ILogger; namespace PMSWPF.ViewModels; partial class VariableTableViewModel : ViewModelBase { + + private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); + private readonly IDialogService _dialogService; + // private readonly ILogger _logger; - [ObservableProperty] private VariableTable variableTable; - [ObservableProperty] private ObservableCollection _dataVariables; + [ObservableProperty] + private VariableTable variableTable; + + [ObservableProperty] + private ObservableCollection _dataVariables; /// /// 是否是第一次加载,防止ToggleSwitch第一次加载触发改变事件 @@ -20,35 +30,66 @@ partial class VariableTableViewModel : ViewModelBase public bool IsLoadCompletion { get; set; } = false; private readonly VarTableRepository _varTableRepository; + private readonly VarDataRepository _varDataRepository; - public VariableTableViewModel() + + public VariableTableViewModel(IDialogService dialogService) { + _dialogService = dialogService; IsLoadCompletion = false; // _logger = logger; _varTableRepository = new VarTableRepository(); + _varDataRepository = new VarDataRepository(); } - - + public override void OnLoaded() { - if (VariableTable.DataVariables != null) { DataVariables = new ObservableCollection(VariableTable.DataVariables); } + IsLoadCompletion = true; } + [RelayCommand] + public async void AddVarData(VariableTable variableTable) + { + try + { + // // 1. 显示添加设备对话框 + var varData = await _dialogService.ShowAddVarDataDialog(); + // // 如果用户取消或对话框未返回设备,则直接返回 + if (varData == null) + { + // _logger.LogInformation("用户取消了添加设备操作。"); + return; + } + + varData.VariableTableId = variableTable.Id; + var addVarData = await _varDataRepository.AddAsync(varData); + var msg = addVarData.Id > 0 ? $"添加变量成功:{varData?.Name}" : $"添加变量成功:{varData.Name}"; + var type = addVarData.Id > 0 ? NotificationType.Success : NotificationType.Error; + NotificationHelper.ShowMessage(msg, type); + } + catch (Exception e) + { + string msg = $"添加变量的过程中发生了不可预期的错误:"; + Logger.Error(msg + e); + NotificationHelper.ShowMessage(msg + e.Message, NotificationType.Error); + + } + } + + public async Task OnIsActiveChanged(bool active) { - var res = await _varTableRepository.Edit(VariableTable); if (res > 0) { var statusMessage = active ? "已启用" : "已停用"; NotificationHelper.ShowMessage($"变量表:{VariableTable.Name},{statusMessage}", NotificationType.Success); - } else { @@ -56,6 +97,4 @@ partial class VariableTableViewModel : ViewModelBase // _logger.LogInformation($"变量表:{VariableTable.Name},状态修改失败,状态:{active}"); } } - - } \ No newline at end of file diff --git a/Views/Dialogs/VarDataDialog.xaml b/Views/Dialogs/VarDataDialog.xaml new file mode 100644 index 0000000..a948a6b --- /dev/null +++ b/Views/Dialogs/VarDataDialog.xaml @@ -0,0 +1,119 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Views/Dialogs/VarDataDialog.xaml.cs b/Views/Dialogs/VarDataDialog.xaml.cs new file mode 100644 index 0000000..b97f08a --- /dev/null +++ b/Views/Dialogs/VarDataDialog.xaml.cs @@ -0,0 +1,17 @@ +using PMSWPF.ViewModels.Dialogs; +using System.Windows.Controls; + +namespace PMSWPF.Views.Dialogs; + +public partial class VarDataDialog +{ + public VarDataDialog() + { + InitializeComponent(); + } + + public VarDataDialog(VarDataDialogViewModel viewModel) : this() + { + DataContext = viewModel; + } +} \ No newline at end of file diff --git a/Views/VariableTableView.xaml b/Views/VariableTableView.xaml index c3fc0f5..c70817f 100644 --- a/Views/VariableTableView.xaml +++ b/Views/VariableTableView.xaml @@ -45,9 +45,10 @@ - +