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
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]);