mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-06-26 12:55:00 +00:00
enhance: make search filter launcher page specific
This commit is contained in:
parent
118dccbeb5
commit
eb139988e9
2 changed files with 19 additions and 1 deletions
|
@ -22,8 +22,11 @@ namespace SourceGit.ViewModels
|
||||||
get => _activePage;
|
get => _activePage;
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
if (SetProperty(ref _activePage, value))
|
var old = _activePage;
|
||||||
|
if (SetProperty(ref _activePage, value)) {
|
||||||
PopupHost.Active = value;
|
PopupHost.Active = value;
|
||||||
|
UpdateSearchFilter(old, value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -379,6 +382,14 @@ namespace SourceGit.ViewModels
|
||||||
page.Data = null;
|
page.Data = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void UpdateSearchFilter(LauncherPage oldPage, LauncherPage newPage) {
|
||||||
|
if (oldPage != null) {
|
||||||
|
oldPage.SearchFilter = Welcome.Instance.SearchFilter;
|
||||||
|
}
|
||||||
|
|
||||||
|
Welcome.Instance.SearchFilter = newPage.SearchFilter;
|
||||||
|
}
|
||||||
|
|
||||||
private LauncherPage _activePage = null;
|
private LauncherPage _activePage = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,6 +24,12 @@ namespace SourceGit.ViewModels
|
||||||
set;
|
set;
|
||||||
} = new AvaloniaList<Models.Notification>();
|
} = new AvaloniaList<Models.Notification>();
|
||||||
|
|
||||||
|
public string SearchFilter
|
||||||
|
{
|
||||||
|
get => _searchFilter;
|
||||||
|
set => SetProperty(ref _searchFilter, value);
|
||||||
|
}
|
||||||
|
|
||||||
public LauncherPage()
|
public LauncherPage()
|
||||||
{
|
{
|
||||||
_node = new RepositoryNode() { Id = Guid.NewGuid().ToString() };
|
_node = new RepositoryNode() { Id = Guid.NewGuid().ToString() };
|
||||||
|
@ -49,5 +55,6 @@ namespace SourceGit.ViewModels
|
||||||
|
|
||||||
private RepositoryNode _node = null;
|
private RepositoryNode _node = null;
|
||||||
private object _data = null;
|
private object _data = null;
|
||||||
|
private string _searchFilter = string.Empty;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue