mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 04:34:59 +00:00
fix: welcome page should use a shared singleton instance to manage and filter repositories (#117)
This commit is contained in:
parent
06ca29b2b2
commit
4af8cc18d2
5 changed files with 5 additions and 11 deletions
|
@ -9,10 +9,7 @@ namespace SourceGit.ViewModels
|
|||
{
|
||||
public class Welcome : ObservableObject
|
||||
{
|
||||
public bool IsClearSearchVisible
|
||||
{
|
||||
get => !string.IsNullOrEmpty(_searchFilter);
|
||||
}
|
||||
public static Welcome Instance => _instance;
|
||||
|
||||
public AvaloniaList<RepositoryNode> RepositoryNodes
|
||||
{
|
||||
|
@ -25,10 +22,7 @@ namespace SourceGit.ViewModels
|
|||
set
|
||||
{
|
||||
if (SetProperty(ref _searchFilter, value))
|
||||
{
|
||||
Referesh();
|
||||
OnPropertyChanged(nameof(IsClearSearchVisible));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -205,6 +199,7 @@ namespace SourceGit.ViewModels
|
|||
}
|
||||
}
|
||||
|
||||
private static Welcome _instance = new Welcome();
|
||||
private string _searchFilter = string.Empty;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue