fix: should not use Active to close a running popup.

This commit is contained in:
leo 2024-03-05 17:15:09 +08:00
parent 4b405dfc5f
commit f00ecbd0a1
2 changed files with 6 additions and 18 deletions

View file

@ -21,24 +21,11 @@ namespace SourceGit.ViewModels {
Active.Popup = popup;
}
public static async void ShowAndStartPopup(Popup popup) {
popup.HostPageId = Active.GetId();
Active.Popup = popup;
if (!popup.Check()) return;
popup.InProgress = true;
var task = popup.Sure();
if (task != null) {
var finished = await task;
if (finished) {
Active.Popup = null;
} else {
popup.InProgress = false;
}
} else {
Active.Popup = null;
}
public static void ShowAndStartPopup(Popup popup) {
var dumpPage = Active;
popup.HostPageId = dumpPage.GetId();
dumpPage.Popup = popup;
dumpPage.ProcessPopup();
}
public virtual string GetId() {

View file

@ -282,6 +282,7 @@
</StackPanel>
<TextBlock HorizontalAlignment="Stretch"
TextWrapping="Wrap"
FontSize="12"
FontStyle="Italic"
Text="{Binding ProgressDescription}"/>
<ProgressBar Margin="0,8,0,0"