How to override or change Expander, move icon to left side

WPF Studio, Themes, and Shared Library for WPF Forum

Posted 10 years ago by Matthew Eshleman
Version: 14.2.0610

I have inherited a wpf project from a departed engineer. This project is using actipro for various features, including Themes. I'm also new to wpf/xaml, although I have plenty of C# experience.

One view is using an Expander. The xaml is just this simple:

//in resources:
<Style x:Key="DataFileListContainerStyle" TargetType="{x:Type GroupItem}">
<Setter Property="Template">
<Expander Header="{Binding Name}" IsExpanded="True">
<ItemsPresenter />

<ListBox BorderThickness="0"
ItemsSource="{Binding Files}" SelectedValue="{Binding SelectedDataFile}">
<TextBlock Margin="1,1,1,1">
<Binding Path="FilePath"/>
<GroupStyle ContainerStyle="{StaticResource DataFileListContainerStyle}"/>


The problem is the default actipro expander has the expand icon all the way on the right, which in some cases is "off screen". I would prefer the icon to always be on the left, same as the default wpf expander. How do I do this? 

Comments (1)

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

Hi Matthew,

You would need to provide a custom Expander template to achieve this alternate look.  If you take a peek at our "AnimatedExpander" demo's source in the Sample Browser, you can see an example of making custom templates for this control.  That should help you out.  The ToggleButton portion is the main part you'd want to alter from the default style.

Actipro Software Support

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

Add Comment

Please log in to a validated account to post comments.