2025-07-04 13:41:50 +08:00
|
|
|
using System.Collections.ObjectModel;
|
|
|
|
|
using CommunityToolkit.Mvvm.ComponentModel;
|
|
|
|
|
|
2025-07-19 11:11:01 +08:00
|
|
|
namespace DMS.WPF.ViewModels.Dialogs;
|
2025-07-04 13:41:50 +08:00
|
|
|
|
|
|
|
|
public partial class ImportExcelDialogViewModel : ObservableObject
|
|
|
|
|
{
|
|
|
|
|
[ObservableProperty]
|
|
|
|
|
private string? _filePath;
|
|
|
|
|
|
|
|
|
|
[ObservableProperty]
|
2025-07-26 10:05:43 +08:00
|
|
|
private ObservableCollection<DMS.Core.Models.Variable> _variables = new();
|
2025-07-04 13:41:50 +08:00
|
|
|
|
|
|
|
|
partial void OnFilePathChanged(string? value)
|
|
|
|
|
{
|
2025-07-26 10:05:43 +08:00
|
|
|
// if (string.IsNullOrEmpty(value))
|
|
|
|
|
// {
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// try
|
|
|
|
|
// {
|
|
|
|
|
// var data = ExcelHelper.ImprotFromTiaVariableTable(value);
|
|
|
|
|
// Variables = new ObservableCollection<DMS.Core.Models.Variable>(data);
|
|
|
|
|
// }
|
|
|
|
|
// catch (System.Exception ex)
|
|
|
|
|
// {
|
|
|
|
|
// // Handle exception
|
|
|
|
|
// }
|
2025-07-04 13:41:50 +08:00
|
|
|
}
|
|
|
|
|
}
|