Posted 7 years ago by MCRXB
Version: 12.2.0573
Avatar

I'm using Themes to style the native WPF controls. It works greate except when I apply the following setter to the list box item container style. I'm using a datatemplate for the items and couldn't find any other way to make the item stretch to the width of the list box.

<ListBox.ItemContainerStyle>
  <Style TargetType="ListBoxItem">
    <Setter Property="HorizontalContentAlignment" Value="Stretch" />
  </Style>
</ListBox.ItemContainerStyle>

 How can I use this setter and preserve the Actipro styles without duplicating the entire style inline?

Comments (1)

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

Hello, we provide all our styles via the SharedResourceKeys properties.  So you can add this to your Style tag:

BasedOn="{StaticResource {x:Static themes:SharedResourceKeys.ListBoxItemStyleKey}}"


Actipro Software Support

The latest build of this product (v2019.1 build 0683) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.