mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-17 20:28:00 +01:00
[projects] Adding info message for cases: there are no projects or no results for the search
This commit is contained in:
@@ -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()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user