diff --git a/CapMachine.Model/HistoryWorkCondFile.cs b/CapMachine.Model/HistoryWorkCondFile.cs
index bc8eb49..f1928a5 100644
--- a/CapMachine.Model/HistoryWorkCondFile.cs
+++ b/CapMachine.Model/HistoryWorkCondFile.cs
@@ -1,4 +1,5 @@
using FreeSql.DataAnnotations;
+using System.ComponentModel;
namespace CapMachine.Model
{
@@ -49,5 +50,23 @@ namespace CapMachine.Model
///
public long HistoryExpId { get; set; }
public HistoryExp? HistoryExp { get; set; }
+
+ [Column(IsIgnore = true)]
+ public bool IsSelected
+ {
+ get { return _isSelected; }
+ set
+ {
+ if (_isSelected != value)
+ {
+ _isSelected = value;
+ PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(IsSelected)));
+ }
+ }
+ }
+
+ private bool _isSelected;
+
+ public event PropertyChangedEventHandler? PropertyChanged;
}
}
diff --git a/CapMachine.Wpf/ViewModels/HistoryDataViewModel.cs b/CapMachine.Wpf/ViewModels/HistoryDataViewModel.cs
index bd17564..1b5026b 100644
--- a/CapMachine.Wpf/ViewModels/HistoryDataViewModel.cs
+++ b/CapMachine.Wpf/ViewModels/HistoryDataViewModel.cs
@@ -15,8 +15,8 @@ using Prism.Events;
using Prism.Regions;
using Prism.Services.Dialogs;
using System;
+using System.Collections;
using System.Collections.Generic;
-using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Globalization;
using System.IO;
@@ -51,7 +51,7 @@ namespace CapMachine.Wpf.ViewModels
///
///
///
- public HistoryDataViewModel(IDialogService dialogService, IFreeSql freeSql, IEventAggregator eventAggregator, IMapper mapper,ConfigService configService)
+ public HistoryDataViewModel(IDialogService dialogService, IFreeSql freeSql, IEventAggregator eventAggregator, IMapper mapper, ConfigService configService)
{
DialogService = dialogService;
FreeSql = freeSql;
@@ -132,6 +132,20 @@ namespace CapMachine.Wpf.ViewModels
set { _IsLeftDrawerOpen = value; RaisePropertyChanged(); }
}
+ private bool _IsBusy;
+ public bool IsBusy
+ {
+ get { return _IsBusy; }
+ set { _IsBusy = value; RaisePropertyChanged(); }
+ }
+
+ private string _BusyMessage = "正在加载,请稍候...";
+ public string BusyMessage
+ {
+ get { return _BusyMessage; }
+ set { _BusyMessage = value; RaisePropertyChanged(); }
+ }
+
///
@@ -224,15 +238,7 @@ namespace CapMachine.Wpf.ViewModels
set { _SelectedHistoryExp = value; RaisePropertyChanged(); }
}
- private HistoryWorkCondFile _SelectedHistoryWorkCondFile;
- ///
- /// 选中的历史数据文件
- ///
- public HistoryWorkCondFile SelectedHistoryWorkCondFile
- {
- get { return _SelectedHistoryWorkCondFile; }
- set { _SelectedHistoryWorkCondFile = value; RaisePropertyChanged(); }
- }
+
///
/// 当前搜索的工况条件
@@ -268,7 +274,13 @@ namespace CapMachine.Wpf.ViewModels
if (par is HistoryExp)
{
SelectedHistoryExp = par as HistoryExp;
- ListHistoryWorkCondFile = SelectedHistoryExp!.HistoryWorkCondFiles!;
+ var files = SelectedHistoryExp!.HistoryWorkCondFiles!;
+ foreach (var f in files)
+ {
+ if (f != null) f.IsSelected = false;
+ }
+ ListHistoryWorkCondFile = files.ToList();
+ //ListHistoryWorkCondFile = ListHistoryWorkCondFile.ToList();
return;
}
if ((par as SelectionChangedEventArgs)!.AddedItems.Count == 0)
@@ -290,63 +302,18 @@ namespace CapMachine.Wpf.ViewModels
if (Selecteddata != null)
{
SelectedHistoryExp = Selecteddata;
- ListHistoryWorkCondFile = SelectedHistoryExp.HistoryWorkCondFiles!;
- }
- }
-
-
- private DelegateCommand