自动加载dbc

This commit is contained in:
hsc
2026-07-09 16:19:20 +08:00
parent b21c1901e1
commit 412b56935c
5 changed files with 83 additions and 12 deletions

View File

@@ -164,9 +164,9 @@ namespace CANModule.ViewModels
set => SetProperty(ref _IsSaved, value);
}
public ObservableCollection<AutoDBCLoadItem> dbcAutoLoadList
public ObservableCollection<AutoDBCLoadItem> DBCAutoLoadList
{
get => _systemConfig?.dbcAutoLoadList ?? new ObservableCollection<AutoDBCLoadItem>();
get => _systemConfig?.DBCAutoLoadList ?? new ObservableCollection<AutoDBCLoadItem>();
}
private AutoDBCLoadItem _SelectedDcAutoLoad;
@@ -360,7 +360,7 @@ namespace CANModule.ViewModels
RaisePropertyChanged(nameof(BLFPath));
RaisePropertyChanged(nameof(DBCPath));
RaisePropertyChanged(nameof(dbcAutoLoadList));
RaisePropertyChanged(nameof(DBCAutoLoadList));
}
public override void OnNavigatedFrom(NavigationContext navigationContext)
@@ -413,7 +413,7 @@ namespace CANModule.ViewModels
{
if (SelectedDcAutoLoad != null)
{
dbcAutoLoadList.Remove(SelectedDcAutoLoad);
DBCAutoLoadList.Remove(SelectedDcAutoLoad);
}
}
@@ -491,10 +491,10 @@ namespace CANModule.ViewModels
if (re && IsSaved)
{
var item = dbcAutoLoadList.FirstOrDefault(s => s.DBCChannel == DBCChannel);
var item = DBCAutoLoadList.FirstOrDefault(s => s.DBCChannel == DBCChannel);
if (item == null)
{
dbcAutoLoadList.Add(new AutoDBCLoadItem
DBCAutoLoadList.Add(new AutoDBCLoadItem
{
DBCFilePath = DBCPath,
DBCChannel = DBCChannel
@@ -502,8 +502,8 @@ namespace CANModule.ViewModels
}
else
{
dbcAutoLoadList.Remove(item);
dbcAutoLoadList.Add(new AutoDBCLoadItem
DBCAutoLoadList.Remove(item);
DBCAutoLoadList.Add(new AutoDBCLoadItem
{
DBCFilePath = DBCPath,
DBCChannel = DBCChannel

View File

@@ -124,7 +124,7 @@
<Label Content="加载记录保存"
VerticalContentAlignment="Center" />
</StackPanel>
<DataGrid ItemsSource="{Binding dbcAutoLoadList}"
<DataGrid ItemsSource="{Binding DBCAutoLoadList}"
Width="650"
IsReadOnly="True"
AutoGenerateColumns="False"