mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 04: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
|
@ -7,7 +7,7 @@ namespace SourceGit.ViewModels
|
|||
{
|
||||
public Models.Commit Target
|
||||
{
|
||||
get => _target;
|
||||
get;
|
||||
}
|
||||
|
||||
[Required(ErrorMessage = "Commit message is required!!!")]
|
||||
|
@ -20,10 +20,8 @@ namespace SourceGit.ViewModels
|
|||
public Squash(Repository repo, Models.Commit target, string shaToGetPreferMessage)
|
||||
{
|
||||
_repo = repo;
|
||||
_target = target;
|
||||
_message = new Commands.QueryCommitFullMessage(_repo.FullPath, shaToGetPreferMessage).Result();
|
||||
|
||||
View = new Views.Squash() { DataContext = this };
|
||||
Target = target;
|
||||
}
|
||||
|
||||
public override Task<bool> Sure()
|
||||
|
@ -66,7 +64,6 @@ namespace SourceGit.ViewModels
|
|||
}
|
||||
|
||||
private readonly Repository _repo;
|
||||
private Models.Commit _target;
|
||||
private string _message;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue