enhance: prevent property changed event if it is unchanged

This commit is contained in:
leo 2024-07-26 10:22:42 +08:00
parent aae1c41dcd
commit 85ce2f9cab
No known key found for this signature in database
2 changed files with 27 additions and 31 deletions

View file

@ -137,7 +137,8 @@ namespace SourceGit.ViewModels
}
else
{
SelectedStaged = [];
if (_selectedStaged != null && _selectedStaged.Count > 0)
SelectedStaged = [];
if (value.Count == 1)
SetDetail(value[0]);
@ -162,7 +163,8 @@ namespace SourceGit.ViewModels
}
else
{
SelectedUnstaged = [];
if (_selectedUnstaged != null && _selectedUnstaged.Count > 0)
SelectedUnstaged = [];
if (value.Count == 1)
SetDetail(value[0]);