code_review: review PR #68

* use Converters.ListConverters.ToCount instead of adding two properties to get the count of list.
* adding a new TextBlock to show number of files
This commit is contained in:
leo 2024-04-12 10:03:24 +08:00
parent 0e2da217f1
commit ede96c298e
3 changed files with 17 additions and 53 deletions

View file

@ -7,7 +7,7 @@ namespace SourceGit.Converters
public static class ListConverters
{
public static readonly FuncValueConverter<IList, string> ToCount =
new FuncValueConverter<IList, string>(v => $" ({v.Count})");
new FuncValueConverter<IList, string>(v => v == null ? " (0)" : $" ({v.Count})");
public static readonly FuncValueConverter<IList, bool> IsNotNullOrEmpty =
new FuncValueConverter<IList, bool>(v => v != null && v.Count > 0);