/// <inheritdoc/> protected override void OnDetachedFromVisualTree(VisualTreeAttachmentEventArgs e) { base.OnDetachedFromVisualTree(e); if (_accessKeys != null && AccessKey != 0) { _accessKeys.Unregister(this); _accessKeys = null; } }
/// <summary> /// Called when the control is detached from a visual tree. /// </summary> /// <param name="root">The root of the visual tree.</param> protected override void OnDetachedFromVisualTree(IRenderRoot root) { base.OnDetachedFromVisualTree(root); if (_accessKeys != null && AccessKey != 0) { _accessKeys.Unregister(this); _accessKeys = null; } }