Closed bisato closed 8 years ago
Hello,
the AddValueChanged in the ctor of ToggleSwitch is preventing the disposing of ToggleSwitch. See here. I propose to add this to the ctor:
this.Unloaded += OnUnloaded;
and then add this method:
private void OnUnloaded(object sender, RoutedEventArgs routedEventArgs) { this.Unloaded -= OnUnloaded; // Unlisten to the BorderThickness changed event to update the layout var dpd = DependencyPropertyDescriptor.FromProperty(BorderThicknessProperty, typeof(ToggleSwitch)); dpd?.RemoveValueChanged(this, EventHandler); }
Done. Thank you.
Hello,
the AddValueChanged in the ctor of ToggleSwitch is preventing the disposing of ToggleSwitch. See here. I propose to add this to the ctor:
this.Unloaded += OnUnloaded;
and then add this method: