Here's something I want to do:
<Application.Resources>
<Style TargetType="{x:Type UIElement}">
<Setter Property="Opacity"
Value=".1" />
</Style>
</Application.Resources>
So that I can style any type (not just some final concrete UI type). I am not looking for best practices, its more of a question to ponder.
I noticed that WPF does not style any super class specified in TargetType (UIElement, FrameworkElement, etc etc). It styles only if the TargetType equates to the concrete UI class (Button, Rectangle).
if you just want to define a base Style, you can however use BasedOn property.
<Style TargetType="FrameworkElement" x:Key="ElementBase">
<Setter Property="Height" Value="24"/>
</Style>
<Style TargetType="TextBlock" BasedOn="{StaticResource ElementBase}">
</Style>
It is a little bit more work, but maybe it helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With