diff --git a/src/Converters/ListConverters.cs b/src/Converters/ListConverters.cs index 2adb37e1..dac55076 100644 --- a/src/Converters/ListConverters.cs +++ b/src/Converters/ListConverters.cs @@ -7,7 +7,7 @@ namespace SourceGit.Converters public static class ListConverters { public static readonly FuncValueConverter ToCount = - new FuncValueConverter(v => $" ({v.Count})"); + new FuncValueConverter(v => v == null ? " (0)" : $" ({v.Count})"); public static readonly FuncValueConverter IsNotNullOrEmpty = new FuncValueConverter(v => v != null && v.Count > 0); diff --git a/src/ViewModels/WorkingCopy.cs b/src/ViewModels/WorkingCopy.cs index f330c70f..83cff278 100644 --- a/src/ViewModels/WorkingCopy.cs +++ b/src/ViewModels/WorkingCopy.cs @@ -46,25 +46,13 @@ namespace SourceGit.ViewModels public List Unstaged { get => _unstaged; - private set - { - if (SetProperty(ref _unstaged, value)) - { - OnPropertyChanged(nameof(UnstagedCount)); - } - } + private set => SetProperty(ref _unstaged, value); } public List Staged { get => _staged; - private set - { - if (SetProperty(ref _staged, value)) - { - OnPropertyChanged(nameof(StagedCount)); - } - } + private set => SetProperty(ref _staged, value); } public int Count @@ -72,16 +60,6 @@ namespace SourceGit.ViewModels get => _count; } - public int UnstagedCount - { - get => _unstaged.Count; - } - - public int StagedCount - { - get => _staged.Count; - } - public Models.Change SelectedUnstagedChange { get => _selectedUnstagedChange; diff --git a/src/Views/WorkingCopy.axaml b/src/Views/WorkingCopy.axaml index 11031c07..3e52ffc3 100644 --- a/src/Views/WorkingCopy.axaml +++ b/src/Views/WorkingCopy.axaml @@ -20,20 +20,13 @@ - + - - - - - - - + + + - - - - -