Shikihane
Shikihane

Reputation: 1

How can turn off MahApps Button transparent effect?

I have a MahApps button as follows:

<Button Style="{StaticResource MahApps.Styles.Button.Chromeless}" Foreground="Blue" Content="{icon:Modern Kind=Add}"></Button>

I don't want it to have a transparency effect, but I don't know how to do it. I tried to set the Foreground property and so on, but to no avail.

Button with tranparenccy effect.

Upvotes: 0

Views: 284

Answers (1)

thatguy
thatguy

Reputation: 22089

You can simply set the Background. The Foreground only affects the glyph or text content.

<Button Style="{StaticResource MahApps.Styles.Button.Chromeless}" Foreground="Blue" Background="Red" Content="{iconPacks:Modern Kind=Add}"/>

Alternatively, use any of the other Button styles that already have a background set.

<Button Style="{StaticResource MahApps.Styles.Button.Flat}" Foreground="Blue" Content="{iconPacks:Modern Kind=Add}"/>
<Button Style="{StaticResource MahApps.Styles.Button.Square}" Foreground="Blue" Content="{iconPacks:Modern Kind=Add}"/>

Upvotes: 1

Related Questions