mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-06-07 20:04:59 +00:00
refactor: use view locator instead of creating views manually in viewmodels (#1213)
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
413669741d
commit
5fd074a9b6
60 changed files with 52 additions and 140 deletions
|
@ -6,23 +6,19 @@ namespace SourceGit.ViewModels
|
|||
{
|
||||
public RepositoryNode Node
|
||||
{
|
||||
get => _node;
|
||||
set => SetProperty(ref _node, value);
|
||||
get;
|
||||
}
|
||||
|
||||
public DeleteRepositoryNode(RepositoryNode node)
|
||||
{
|
||||
_node = node;
|
||||
View = new Views.DeleteRepositoryNode() { DataContext = this };
|
||||
Node = node;
|
||||
}
|
||||
|
||||
public override Task<bool> Sure()
|
||||
{
|
||||
Preferences.Instance.RemoveNode(_node, true);
|
||||
Preferences.Instance.RemoveNode(Node, true);
|
||||
Welcome.Instance.Refresh();
|
||||
return null;
|
||||
}
|
||||
|
||||
private RepositoryNode _node = null;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue