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,8 +38,7 @@ namespace SourceGit.UI {
dialog.type.Data = dialog.FindResource("Icon.Branch") as Geometry;
dialog.desc.Content = branch.Name;
var popup = App.GetPopupManager(opened);
popup?.Show(dialog);
opened.GetPopupManager()?.Show(dialog);
}
/// <summary>
@ -57,8 +56,7 @@ namespace SourceGit.UI {
dialog.type.Data = dialog.FindResource("Icon.Commit") as Geometry;
dialog.desc.Content = $"{commit.ShortSHA} {commit.Subject}";
var popup = App.GetPopupManager(opened);
popup?.Show(dialog);
opened.GetPopupManager()?.Show(dialog);
}
/// <summary>
@ -67,7 +65,7 @@ namespace SourceGit.UI {
/// <param name="sender"></param>
/// <param name="e"></param>
private async void Start(object sender, RoutedEventArgs e) {
var popup = App.GetPopupManager(repo);
var popup = repo.GetPopupManager();
popup?.Lock();
var autoStash = chkAutoStash.IsChecked == true;
@ -77,7 +75,7 @@ namespace SourceGit.UI {
}
private void Cancel(object sender, RoutedEventArgs e) {
App.GetPopupManager(repo)?.Close();
repo.GetPopupManager()?.Close();
}
}
}