/// <summary>
 /// Propagate <see cref="XPPanelControl.TextStyle.PropertyChange"/> events to our owner/parent/listeners
 /// </summary>
 /// <param name="sender">The <see cref="TextStyle"/> that changed</param>
 /// <param name="e">The property that changed</param>
 private void textStyle_PropertyChange(object sender, TextElementPropertyChangeEventArgs e)
 {
     if (propertyChangeListeners != null) {
         propertyChangeListeners(this,e) ;
     }
 }
        /// <summary>
        /// The attributes of a <see cref="TextElement"/> within the <see cref="Elements"/> collection 
        /// has changed
        /// </summary>
        /// <param name="sender">The <see cref="TextElementCollection"/> that changed</param>
        /// <param name="e"><see cref="TextElementPropertyChangeEventArgs"/> specifying the <see cref="TextElement"/>
        /// and the property that changed</param>
        private void textElementCollection_ElementChange(object sender, TextElementPropertyChangeEventArgs e)
        {
            switch(e.Property) {
                // all these invalidate the layout
                case TextElementProperty.FontProperty:
                case TextElementProperty.HorizontalAlignmentProperty:
                case TextElementProperty.VerticalAlignmentProperty:
                case TextElementProperty.StyleProperty:
                case TextElementProperty.VisibleProperty:
                case TextElementProperty.SpacingAdjustmentProperty:
                case TextElementProperty.ImageSetProperty:
                case TextElementProperty.ImageProperty:
                case TextElementProperty.TextProperty:
                case TextElementProperty.PrefixProperty:
                case TextElementProperty.IndentProperty:
                    isLayoutDirty = true ;
                    break ;

                // all these force a redraw
                case TextElementProperty.TextColorProperty:
                case TextElementProperty.BackColorProperty:
                case TextElementProperty.OtherProperty:
                    break ;
            }

            if (!IsRedrawSuspended) {
                Invalidate() ;
            }
        }
 protected virtual void OnElementChangeEvent(TextElementPropertyChangeEventArgs eventArgs)
 {
     if (elementChangeListeners != null) {
         elementChangeListeners(this,eventArgs) ;
     }
 }
 /// <summary>
 /// Handle <see cref="TextElement"/> changes so they can be forwarded if neccessary
 /// </summary>
 /// <param name="sender">The <see cref="TextElement"/></param>
 /// <param name="e"><see cref="TextElementPropertyChangeEventArgs"/> describing the property change</param>
 private void TextElementCollection_PropertyChange(object sender, TextElementPropertyChangeEventArgs e)
 {
     OnElementChangeEvent(e) ;
 }