AnimatedExpander not honoring HorizontalAlignment and no contrasting color

Ribbon for WPF Forum

Posted 12 years ago by David Sherwood
Version: 12.1.0560
Platform: .NET 4.0
Environment: Windows 8 (64-bit)
Avatar

I just installed 2012.1 and having 2 problems with AnimatedExpander. Firstly,  It is ignoring HorizontalAlignment="Center" in the header. My XAML looks like this(simplified):

 <shared:AnimatedExpander  ExpandDirection="Right" >
        <shared:AnimatedExpander.Header >
            <AccessText Text="_1. Book" HorizontalAlignment="Center" />
        </shared:AnimatedExpander.Header>

 The header text does not render "center" but instead "left"  which apperars at the bottom since the expansion direction is "Right". The Control that this is in is fairly tall, so the text is far from the arrow button.

This is componded by the second  problem: The background color is the same as the control. This makes the button and text look like two separate things. Only when you hover do you get a contrasting color. 

I tried unsuccessfully to work around the second problem. Suppling Background color on the header only happens to the text. Supplying on the control,changes the background for the entire content. 

Comments (3)

Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi David,

We've tweaked the style for the header's content alignment in today's maintenance release to fix the alignment issue.

For changing colors, please see the AnimatedExpander demo in the Shared Library's samples.  It shows several ways of changing the look.  Or you could just use a larger font and different forecolor for the header text to make it look different than content.


Actipro Software Support

Posted 12 years ago by David Sherwood
Avatar

Changing the header's foreground or background only changes the text and not the expander bar. The button and text need to appear as one thing either by having a contrasting background for the whole bar or by placing a border around it. In the 2011 version, the bar (the text and button) has a gray background and then changes color when you hover over it.
As to checking out the sample, I can't because the 2012 browser does not work (I've reported this as separate problem).
Having the button and header text appear as two separate things is a deal breaker for me. I can’t upgrade my application to 2012 because of this. And having to re-style all of my animated expanders is no solution.

Answer - Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi David,

Once you get the Sample Browser working, you'll be able to see how to set custom colors for an expander.  The AnimatedExpander demo shows it.  All you need to do is redefine the AssetResourceKeys brushes in your App.Resources, such as ExpanderHeaderBackgroundNormalBrushKey and ExpanderHeaderBackgroundHoverBrushKey.


Actipro Software Support

The latest build of this product (v24.1.2) was released 4 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.