refactor(PopupManager): rewrite popup

This commit is contained in:
leo 2020-08-06 15:41:25 +08:00
parent 28e3a1bb27
commit 7558bbd4f2
34 changed files with 183 additions and 221 deletions

View file

@ -38,7 +38,7 @@ namespace SourceGit.UI {
/// <param name="opened"></param>
/// <param name="branch"></param>
public static void Show(Git.Repository opened, Git.Branch branch) {
App.GetPopupManager(opened)?.Show(new RenameBranch(opened, branch));
opened.GetPopupManager()?.Show(new RenameBranch(opened, branch));
}
/// <summary>
@ -50,7 +50,7 @@ namespace SourceGit.UI {
txtNewName.GetBindingExpression(TextBox.TextProperty).UpdateSource();
if (Validation.GetHasError(txtNewName)) return;
var popup = App.GetPopupManager(repo);
var popup = repo.GetPopupManager();
popup?.Lock();
await Task.Run(() => branch.Rename(repo, NewName));
popup?.Close(true);
@ -62,7 +62,7 @@ namespace SourceGit.UI {
/// <param name="sender"></param>
/// <param name="e"></param>
private void Cancel(object sender, RoutedEventArgs e) {
App.GetPopupManager(repo)?.Close();
repo.GetPopupManager()?.Close();
}
}
}