Make sure AttachedToLogicalTree is only raised once.
Make sure AttachedToLogicalTree is only raised once.

And add a check to make sure control is attached to logical tree before
detach - I *think* this should always be the case, though there may be
an edge case which triggers this exception, in which case do the same
for DetachedFromLogicalTree as we've done for AttachedToLogicalTree
here.

MrDaedra/Avalonia,AvaloniaUI/Avalonia,wieslawsoltes/Perspex,jkoritzinsky/Avalonia,punker76/Perspex,jkoritzinsky/Avalonia,susloparovdenis/Perspex,grokys/Perspex,OronDF343/Avalonia,AvaloniaUI/Avalonia,akrisiun/Perspex,wieslawsoltes/Perspex,MrDaedra/Avalonia,AvaloniaUI/Avalonia,Perspex/Perspex,jkoritzinsky/Perspex,SuperJMN/Avalonia,SuperJMN/Avalonia,SuperJMN/Avalonia,susloparovdenis/Avalonia,jkoritzinsky/Avalonia,jkoritzinsky/Avalonia,AvaloniaUI/Avalonia,grokys/Perspex,jazzay/Perspex,jkoritzinsky/Avalonia,wieslawsoltes/Perspex,susloparovdenis/Perspex,jkoritzinsky/Avalonia,SuperJMN/Avalonia,susloparovdenis/Avalonia,SuperJMN/Avalonia,Perspex/Perspex,SuperJMN/Avalonia,wieslawsoltes/Perspex,jkoritzinsky/Avalonia,AvaloniaUI/Avalonia,AvaloniaUI/Avalonia,wieslawsoltes/Perspex,wieslawsoltes/Perspex,AvaloniaUI/Avalonia,wieslawsoltes/Perspex,OronDF343/Avalonia,SuperJMN/Avalonia