[projects] Adding info message for cases: there are no projects or no results for the search

This commit is contained in:
donlaci
2024-06-19 14:58:29 +02:00
parent 20a7dd4a7f
commit 90979cbecb
5 changed files with 71 additions and 3 deletions

View File

@@ -30,8 +30,21 @@ namespace ProjectsEditor.ViewModels
get
{
IEnumerable<Project> projects = GetFilteredProjects();
if (projects == null)
IsProjectsViewEmpty = !(projects != null && projects.Any());
OnPropertyChanged(new PropertyChangedEventArgs(nameof(IsProjectsViewEmpty)));
if (IsProjectsViewEmpty)
{
if (Projects != null && Projects.Any())
{
EmptyProjectsViewMessage = Properties.Resources.NoProjectsMatch;
}
else
{
EmptyProjectsViewMessage = Properties.Resources.No_Projects_Message;
}
OnPropertyChanged(new PropertyChangedEventArgs(nameof(EmptyProjectsViewMessage)));
return Enumerable.Empty<Project>();
}
@@ -51,6 +64,10 @@ namespace ProjectsEditor.ViewModels
}
}
public bool IsProjectsViewEmpty { get; set; }
public string EmptyProjectsViewMessage { get; set; }
// return those projects where the project name or any of the selected apps' name contains the search term
private IEnumerable<Project> GetFilteredProjects()
{