mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-06-07 03:45:00 +00:00
refactor: build tags view data in viewmodels instead of views
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
f46bbd01cd
commit
fd935259aa
7 changed files with 151 additions and 172 deletions
|
@ -150,18 +150,12 @@ namespace SourceGit.ViewModels
|
|||
collection.Tree = SubmoduleTreeNode.Build(submodules, oldExpanded);
|
||||
|
||||
var rows = new List<SubmoduleTreeNode>();
|
||||
collection.MakeTreeRows(rows, collection.Tree);
|
||||
MakeTreeRows(rows, collection.Tree);
|
||||
collection.Rows.AddRange(rows);
|
||||
|
||||
return collection;
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
Tree.Clear();
|
||||
Rows.Clear();
|
||||
}
|
||||
|
||||
public void ToggleExpand(SubmoduleTreeNode node)
|
||||
{
|
||||
node.IsExpanded = !node.IsExpanded;
|
||||
|
@ -193,7 +187,7 @@ namespace SourceGit.ViewModels
|
|||
}
|
||||
}
|
||||
|
||||
private void MakeTreeRows(List<SubmoduleTreeNode> rows, List<SubmoduleTreeNode> nodes)
|
||||
private static void MakeTreeRows(List<SubmoduleTreeNode> rows, List<SubmoduleTreeNode> nodes)
|
||||
{
|
||||
foreach (var node in nodes)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue