mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 04:34:59 +00:00
code_style: change static methods of ViewModels.Preference to member function
This commit is contained in:
parent
1e0a2ab5f7
commit
720b2b65f3
13 changed files with 65 additions and 71 deletions
|
@ -44,12 +44,12 @@ namespace SourceGit.Views
|
|||
var root = new Commands.QueryRepositoryRootPath(path).Result();
|
||||
if (string.IsNullOrEmpty(root))
|
||||
{
|
||||
(DataContext as ViewModels.Welcome)?.InitRepository(path, parent);
|
||||
ViewModels.Welcome.Instance.InitRepository(path, parent);
|
||||
return;
|
||||
}
|
||||
|
||||
var normalizedPath = root.Replace("\\", "/");
|
||||
var node = ViewModels.Preference.FindOrAddNodeByRepositoryPath(normalizedPath, parent, true);
|
||||
var node = ViewModels.Preference.Instance.FindOrAddNodeByRepositoryPath(normalizedPath, parent, true);
|
||||
var launcher = this.FindAncestorOfType<Launcher>()?.DataContext as ViewModels.Launcher;
|
||||
launcher?.OpenRepositoryInTab(node, launcher.ActivePage);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue