File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -148,7 +148,6 @@ public Task<bool> DeleteSelectedLootAsync()
148148 return Task . FromResult ( false ) ;
149149 if ( _currentProfile == null || gridLoot . SelectedRows . Count == 0 )
150150 return Task . FromResult ( false ) ;
151-
152151 try
153152 {
154153 // 【新增】设置标志位
@@ -205,4 +204,6 @@ public void ClearSelection()
205204 }
206205
207206 public bool HasFocus => gridLoot . ContainsFocus ;
207+
208+ public bool HasSelectedRecords => gridLoot . SelectedRows . Count > 0 ;
208209}
Original file line number Diff line number Diff line change @@ -334,9 +334,8 @@ public void HandleLootAdded()
334334 // 路由删除逻辑
335335 public async Task < bool > DeleteSelectedRecordAsync ( )
336336 {
337- // 逻辑:如果 Loot 控件拥有焦点,则删除 Loot;否则默认删除 History
338-
339- if ( lootRecordsControl != null && lootRecordsControl . HasFocus )
337+ // 逻辑:如果 Loot 控件有选中记录,则删除 Loot;否则默认删除 History
338+ if ( lootRecordsControl != null && ( lootRecordsControl . HasFocus || lootRecordsControl . HasSelectedRecords ) )
340339 {
341340 return await lootRecordsControl . DeleteSelectedLootAsync ( ) ;
342341 }
You can’t perform that action at this time.
0 commit comments