Steve
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
2 additions and
8 deletions
-
src/Avalonia.Base/Visual.cs
|
|
|
@ -667,14 +667,8 @@ namespace Avalonia |
|
|
|
|
|
|
|
if (_visualParent is IRenderRoot || _visualParent?.IsAttachedToVisualTree == true) |
|
|
|
{ |
|
|
|
var root = this.FindAncestorOfType<IRenderRoot>(); |
|
|
|
if (root is null) |
|
|
|
{ |
|
|
|
Logger.TryGet(LogEventLevel.Error, "Visual")?.Log("Visual", |
|
|
|
"Visual is atached to visual tree but root could not be found."); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
var root = this.FindAncestorOfType<IRenderRoot>() ?? |
|
|
|
throw new AvaloniaInternalException("Visual is atached to visual tree but root could not be found."); |
|
|
|
var e = new VisualTreeAttachmentEventArgs(_visualParent, root); |
|
|
|
OnAttachedToVisualTreeCore(e); |
|
|
|
} |
|
|
|
|