mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-22 14:13:30 -07:00
Remove the finalizer of ControlSizeTrigger (#31)
This commit is contained in:
parent
27abae0099
commit
dce7d2a568
1 changed files with 1 additions and 16 deletions
|
@ -1,4 +1,4 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
using System;
|
||||
|
@ -49,21 +49,6 @@ namespace CalculatorApp.Views.StateTriggers
|
|||
public static readonly DependencyProperty MinWidthProperty =
|
||||
DependencyProperty.Register(nameof(MinWidth), typeof(double), typeof(ControlSizeTrigger), new PropertyMetadata(-1));
|
||||
|
||||
~ControlSizeTrigger()
|
||||
{
|
||||
// CSHARP_MIGRATION: TODO:
|
||||
// finalization will happen on a finalizer's thread.
|
||||
// to prevent crashing the entire app, switch to UI thread to do unregistering work
|
||||
Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
|
||||
{
|
||||
UnregisterSizeChanged(Source);
|
||||
})
|
||||
.AsTask()
|
||||
.ConfigureAwait(false)
|
||||
.GetAwaiter()
|
||||
.GetResult();
|
||||
}
|
||||
|
||||
private void OnSourcePropertyChanged(FrameworkElement oldValue, FrameworkElement newValue)
|
||||
{
|
||||
UnregisterSizeChanged(oldValue);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue