feat: support uninstall.

This commit is contained in:
rabbitism
2024-09-12 18:38:27 +08:00
parent a054d17fd7
commit ea385ee194
2 changed files with 13 additions and 7 deletions

View File

@@ -64,6 +64,15 @@ public abstract class WindowMessageManager : TemplatedControl
}
}
public virtual void Uninstall()
{
if(Parent is AdornerLayer adornerLayer)
{
adornerLayer.Children.Remove(this);
AdornerLayer.SetAdornedElement(this, null);
}
}
protected void TopLevelOnTemplateApplied(object? sender, TemplateAppliedEventArgs e)
{
if (Parent is AdornerLayer adornerLayer)