mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-06-06 11:34: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
|
@ -8,7 +8,6 @@ namespace SourceGit.ViewModels
|
|||
public Models.CustomAction CustomAction
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public ExecuteCustomAction(Repository repo, Models.CustomAction action)
|
||||
|
@ -16,7 +15,6 @@ namespace SourceGit.ViewModels
|
|||
_repo = repo;
|
||||
_args = action.Arguments.Replace("${REPO}", GetWorkdir());
|
||||
CustomAction = action;
|
||||
View = new Views.ExecuteCustomAction() { DataContext = this };
|
||||
}
|
||||
|
||||
public ExecuteCustomAction(Repository repo, Models.CustomAction action, Models.Branch branch)
|
||||
|
@ -24,7 +22,6 @@ namespace SourceGit.ViewModels
|
|||
_repo = repo;
|
||||
_args = action.Arguments.Replace("${REPO}", GetWorkdir()).Replace("${BRANCH}", branch.FriendlyName);
|
||||
CustomAction = action;
|
||||
View = new Views.ExecuteCustomAction() { DataContext = this };
|
||||
}
|
||||
|
||||
public ExecuteCustomAction(Repository repo, Models.CustomAction action, Models.Commit commit)
|
||||
|
@ -32,7 +29,6 @@ namespace SourceGit.ViewModels
|
|||
_repo = repo;
|
||||
_args = action.Arguments.Replace("${REPO}", GetWorkdir()).Replace("${SHA}", commit.SHA);
|
||||
CustomAction = action;
|
||||
View = new Views.ExecuteCustomAction() { DataContext = this };
|
||||
}
|
||||
|
||||
public override Task<bool> Sure()
|
||||
|
@ -58,6 +54,6 @@ namespace SourceGit.ViewModels
|
|||
}
|
||||
|
||||
private readonly Repository _repo = null;
|
||||
private string _args = string.Empty;
|
||||
private readonly string _args;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue