mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-21 04: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
|
@ -48,7 +48,6 @@ namespace SourceGit.ViewModels
|
|||
|
||||
BasedOn = branch;
|
||||
DiscardLocalChanges = false;
|
||||
View = new Views.CreateBranch() { DataContext = this };
|
||||
}
|
||||
|
||||
public CreateBranch(Repository repo, Models.Commit commit)
|
||||
|
@ -58,7 +57,6 @@ namespace SourceGit.ViewModels
|
|||
|
||||
BasedOn = commit;
|
||||
DiscardLocalChanges = false;
|
||||
View = new Views.CreateBranch() { DataContext = this };
|
||||
}
|
||||
|
||||
public CreateBranch(Repository repo, Models.Tag tag)
|
||||
|
@ -68,7 +66,6 @@ namespace SourceGit.ViewModels
|
|||
|
||||
BasedOn = tag;
|
||||
DiscardLocalChanges = false;
|
||||
View = new Views.CreateBranch() { DataContext = this };
|
||||
}
|
||||
|
||||
public static ValidationResult ValidateBranchName(string name, ValidationContext ctx)
|
||||
|
@ -97,7 +94,7 @@ namespace SourceGit.ViewModels
|
|||
|
||||
return Task.Run(() =>
|
||||
{
|
||||
var succ = false;
|
||||
bool succ;
|
||||
if (CheckoutAfterCreated && !_repo.IsBare)
|
||||
{
|
||||
var changes = new Commands.CountLocalChangesWithoutUntracked(_repo.FullPath).Result();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue