Posted 4 months ago by Tommaso Giachi - CTO, Isendu srl
Version: 23.1.4
Avatar

What is the best way to create a Button control that also takes the image and also takes the ThemeManager style?

Ex: 

<ImageButton Icon="..." Text="..." />

I tried to create a user control that has "Button" as its base class but the style is not applied, Thank you!

Comments (1)

Answer - Posted 4 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

If your button inherits the native Button control, you can apply our theme's Style this way in XAML:

Style="{StaticResource {x:Static themes:SharedResourceKeys.ButtonBaseStyleKey}}"

Or if you have a custom default Style for your custom control, you can base it (via BasedOn attribute) off that Style using the same StaticResource reference.


Actipro Software Support

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

Add Comment

Please log in to a validated account to post comments.