|
|
|
@ -42,6 +42,8 @@ namespace Avalonia.Controls.Chrome |
|
|
|
{ |
|
|
|
base.OnApplyTemplate(e); |
|
|
|
|
|
|
|
_captionButtons?.Detach(); |
|
|
|
|
|
|
|
_captionButtons = e.NameScope.Get<CaptionButtons>("PART_CaptionButtons"); |
|
|
|
|
|
|
|
if (VisualRoot is Window window) |
|
|
|
@ -87,6 +89,9 @@ namespace Avalonia.Controls.Chrome |
|
|
|
base.OnDetachedFromVisualTree(e); |
|
|
|
|
|
|
|
_disposables?.Dispose(); |
|
|
|
|
|
|
|
_captionButtons?.Detach(); |
|
|
|
_captionButtons = null; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|