mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-23 20:47:25 -08:00
fix: should not use Active to close a running popup.
This commit is contained in:
parent
4b405dfc5f
commit
f00ecbd0a1
2 changed files with 6 additions and 18 deletions
|
@ -21,24 +21,11 @@ namespace SourceGit.ViewModels {
|
||||||
Active.Popup = popup;
|
Active.Popup = popup;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async void ShowAndStartPopup(Popup popup) {
|
public static void ShowAndStartPopup(Popup popup) {
|
||||||
popup.HostPageId = Active.GetId();
|
var dumpPage = Active;
|
||||||
Active.Popup = popup;
|
popup.HostPageId = dumpPage.GetId();
|
||||||
|
dumpPage.Popup = popup;
|
||||||
if (!popup.Check()) return;
|
dumpPage.ProcessPopup();
|
||||||
|
|
||||||
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 virtual string GetId() {
|
public virtual string GetId() {
|
||||||
|
|
|
@ -282,6 +282,7 @@
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<TextBlock HorizontalAlignment="Stretch"
|
<TextBlock HorizontalAlignment="Stretch"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
|
FontSize="12"
|
||||||
FontStyle="Italic"
|
FontStyle="Italic"
|
||||||
Text="{Binding ProgressDescription}"/>
|
Text="{Binding ProgressDescription}"/>
|
||||||
<ProgressBar Margin="0,8,0,0"
|
<ProgressBar Margin="0,8,0,0"
|
||||||
|
|
Loading…
Reference in a new issue