1
I’m starting to work with WPF because of its resemblance to HTML. I realized through my research that when I use an expression like this Style="{StaticResource MeuStyle}"
looks a lot like a class definition I have in html (class="MeuStyle"
).
Is it possible to merge several styles into a single Staticresource so that it is applied over the Style of that component? My intention is to work similar to bootstrap, where I set 2 classes on a button like this:
In HTML
<button class="btn">MeuButton</button>
<button class="btn btn-success">MeuButton</button>
<button class="btn btn-error">MeuButton</button>
In WPF ~ (what I need)
<Button Content="Button" Style="{StaticResource btn}"/>
<Button Content="Button" Style="{StaticResource btn, btnSuccess}"/>
<Button Content="Button" Style="{StaticResource btn, btnError}"/>
You don’t need to use the tag
visual-studio
when the problem has no relation to the IDE. If you have any questions about this, read this question– Jéf Bueno