Exemple #1
0
 protected override void OnDetachedFromLogicalTree(LogicalTreeAttachmentEventArgs e)
 {
     _styleRoot = null;
     base.OnDetachedFromLogicalTree(e);
     foreach (var l in _layers)
     {
         ((ILogical)l).NotifyDetachedFromLogicalTree(e);
     }
 }
Exemple #2
0
        protected override void OnAttachedToLogicalTree(LogicalTreeAttachmentEventArgs e)
        {
            base.OnAttachedToLogicalTree(e);
            _styleRoot = e.Root;

            foreach (var l in _layers)
            {
                ((ILogical)l).NotifyAttachedToLogicalTree(e);
            }
        }
Exemple #3
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(
            IStyleRoot root,
            ILogical source,
            ILogical parent)
        {
            Contract.Requires <ArgumentNullException>(root != null);
            Contract.Requires <ArgumentNullException>(source != null);

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