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; }
protected override void OnAttachedToLogicalTree(LogicalTreeAttachmentEventArgs e) { base.OnAttachedToLogicalTree(e); _logicalRoot = e.Root; foreach (var l in _layers) { ((ILogical)l).NotifyAttachedToLogicalTree(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) { Contract.Requires <ArgumentNullException>(root != null); Contract.Requires <ArgumentNullException>(source != null); Root = root; Source = source; Parent = parent; }
/// <summary> /// Initializes a new instance of the <see cref="StyledElement"/> class. /// </summary> public StyledElement() { _logicalRoot = this as ILogicalRoot; }