mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-22 14:13:30 -07:00
removes that
since this
can be captured automatically
This commit is contained in:
parent
b3875f0508
commit
27f87716c1
1 changed files with 3 additions and 6 deletions
|
@ -56,20 +56,17 @@ namespace CalculatorApp
|
|||
|
||||
public Task HandleViewRelease()
|
||||
{
|
||||
var that = this;
|
||||
|
||||
TaskCompletionSource<object> tsource = new TaskCompletionSource<object>();
|
||||
|
||||
_ = m_coreDispatcher.RunAsync(CoreDispatcherPriority.Low, new DispatchedHandler(() =>
|
||||
{
|
||||
KeyboardShortcutManager.OnWindowClosed(that.m_viewId);
|
||||
KeyboardShortcutManager.OnWindowClosed(this.m_viewId);
|
||||
Window.Current.Content = null;
|
||||
that.InvokeWindowClosingHandlers();
|
||||
this.InvokeWindowClosingHandlers();
|
||||
// This is to ensure InvokeWindowClosingHandlers is be done before RemoveWindowFromMap
|
||||
// If InvokeWindowClosingHandlers throws any exception we want it to crash the application
|
||||
// so we are OK not setting closingHandlersCompletedEvent in that case
|
||||
tsource.SetResult(new object());
|
||||
that.m_coreDispatcher.StopProcessEvents();
|
||||
this.m_coreDispatcher.StopProcessEvents();
|
||||
Window.Current.Close();
|
||||
}));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue