VisualTreeAttachmentEventArgs.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. // Copyright (c) The Perspex Project. All rights reserved.
  2. // Licensed under the MIT license. See licence.md file in the project root for full license information.
  3. using System;
  4. using Perspex.Rendering;
  5. namespace Perspex
  6. {
  7. /// <summary>
  8. /// Holds the event arguments for the <see cref="Visual.AttachedToVisualTree"/> and
  9. /// <see cref="Visual.DetachedFromVisualTree"/> events.
  10. /// </summary>
  11. public class VisualTreeAttachmentEventArgs : EventArgs
  12. {
  13. /// <summary>
  14. /// Initializes a new instance of the <see cref="VisualTreeAttachmentEventArgs"/> class.
  15. /// </summary>
  16. /// <param name="root">The root visual.</param>
  17. /// <param name="nameScope">The name scope.</param>
  18. public VisualTreeAttachmentEventArgs(IRenderRoot root, INameScope nameScope)
  19. {
  20. Root = root;
  21. NameScope = nameScope;
  22. }
  23. /// <summary>
  24. /// Gets the root of the visual tree that the visual is being attached to or detached from.
  25. /// </summary>
  26. public IRenderRoot Root { get; }
  27. /// <summary>
  28. /// Gets the element's name scope.
  29. /// </summary>
  30. public INameScope NameScope { get; }
  31. }
  32. }