Question about using WPF theme elements in Style's BasedOn

WPF Studio, Themes, and Shared Library for WPF Forum

Posted 12 years ago by Craig - Varigence, Inc.
Version: 10.1.0522
In my WPF application, I have ComboBoxes in several places and currently use a large ResourceDictionary as a theme file. While I don't want to replace that theme with an Actipro theme, I do want to use the Actipro ComboBox style for my controls.

I already have a ComboBox style in my theme file so I intended to do the following:

        TargetType="{x:Type ComboBox}"
        BasedOn="{StaticResource editorsThemes:EditorsCommonDictionary.NativeComboBoxStyleKey}"
        <Setter Property="SnapsToDevicePixels" Value="true" />
        <Setter Property="Template">
However, I got an error indicating that component resource keys cannot be used in BasedOn. I tried other variations but none worked.

Is there a proper way to build a ComboBox style that is based on a ComboBox style from Actipro themes?



Comments (1)

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

The BasedOn value that you are using is close, but a minor change is necessary for it to work:


BasedOn="{StaticResource {x:Static themes:EditorsCommonDictionary.NativeComboBoxStyleKey}}"

Please let us know if you have further questions.

Actipro Software Support

The latest build of this product (v22.1.4) was released 20 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.