Example #1
0
 protected override void OnDetachedFromLogicalTree(LogicalTreeAttachmentEventArgs e)
 {
     _logicalRoot = null;
     base.OnDetachedFromLogicalTree(e);
     foreach (var l in _layers)
     {
         ((ILogical)l).NotifyDetachedFromLogicalTree(e);
     }
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="LogicalTreeAttachmentEventArgs"/> class.
 /// </summary>
 /// <param name="root">The root of the logical tree.</param>
 /// <param name="source">The control being attached/detached.</param>
 /// <param name="parent">The <see cref="Parent"/>.</param>
 public LogicalTreeAttachmentEventArgs(
     ILogicalRoot root,
     ILogical source,
     ILogical?parent)
 {
     Root   = root ?? throw new ArgumentNullException(nameof(root));
     Source = source ?? throw new ArgumentNullException(nameof(source));
     Parent = parent;
 }
Example #3
0
        protected override void OnAttachedToLogicalTree(LogicalTreeAttachmentEventArgs e)
        {
            base.OnAttachedToLogicalTree(e);
            _logicalRoot = e.Root;

            foreach (var l in _layers)
            {
                ((ILogical)l).NotifyAttachedToLogicalTree(e);
            }
        }
Example #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="LogicalTreeAttachmentEventArgs"/> class.
        /// </summary>
        /// <param name="root">The root of the logical tree.</param>
        /// <param name="source">The control being attached/detached.</param>
        /// <param name="parent">The <see cref="Parent"/>.</param>
        public LogicalTreeAttachmentEventArgs(
            ILogicalRoot root,
            ILogical source,
            ILogical parent)
        {
            Contract.Requires <ArgumentNullException>(root != null);
            Contract.Requires <ArgumentNullException>(source != null);

            Root   = root;
            Source = source;
            Parent = parent;
        }
Example #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="StyledElement"/> class.
 /// </summary>
 public StyledElement()
 {
     _logicalRoot = this as ILogicalRoot;
 }