Skip to content

Commit

Permalink
Set ReturnCode on close application by user
Browse files Browse the repository at this point in the history
  • Loading branch information
tinohager committed Jan 30, 2022
1 parent 520856c commit b873cbe
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
Binary file modified doc/EasyPay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion src/Portalum.Zvt.EasyPay/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
WindowStartupLocation="CenterScreen"
Background="{StaticResource SecondaryColor}"
Template="{StaticResource WindowWithColoredTitleBarNoResize}"
Topmost="True" ResizeMode="NoResize">
Topmost="True"
ResizeMode="NoResize" Closing="Window_Closing"
>

<WindowChrome.WindowChrome>
<WindowChrome GlassFrameThickness="0 64 0 0" NonClientFrameEdges="Left,Bottom,Right" />
Expand Down
6 changes: 6 additions & 0 deletions src/Portalum.Zvt.EasyPay/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ public MainWindow(
_ = Task.Run(async () => await this.StartPaymentAsync(amount));
}

private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
Application.Current.Shutdown(-5);
}

private void UpdateStatus(string status, StatusType statusType)
{
this.LabelStatus.Dispatcher.Invoke(() =>
Expand Down Expand Up @@ -122,5 +127,6 @@ private void IntermediateStatusInformationReceived(string status)
{
this.UpdateStatus(status, StatusType.Information);
}

}
}

0 comments on commit b873cbe

Please sign in to comment.