Browse Source

Update Visual.cs

pull/8569/head
Steve 4 years ago
committed by GitHub
parent
commit
9377ce2a8f
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      src/Avalonia.Base/Visual.cs

10
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);
}

Loading…
Cancel
Save