Is it possible to use a PlaceHolder in a WPF Style that could later be assigned a value by the implementing control? Something like:
<Style x:Key="BigButton" TargetType="{x:Type Button}">
<Setter Property="Foreground" Value="#58290a" />
<Setter Property="FontFamily" Value="Lucida Console" />
<Setter Property="FontSize" Value="24" />
<Setter Property="Content">
<Setter.Value>
<StackPanel>
<Image Source=[SOME PLACEHOLDER]></Image>
<TextBlock>[ANOTHER PLACEHOLDER]</TextBlock>
</StackPanel>
</Setter.Value>
</Setter>
</Style>
and then a Button could assign an image path to this place-holder like this:
<Button Name="btn" Style="{StaticResource BigButton}">
<SOME CLEVER WAY OF ASSIGNING A PATH TO Style.Content.StackPanel.Image.Source and Style.Content.StackPanel.TextBlock.Text>
</Button>
This sounds like a job for Attached properties.
Create a utility class with you “placeholder properties”:
Apply those properties on a Button..
..and use the property values in your Style:
NOTE: Don’t set any other content on the Button, like
<Button Content="..." />or<Button ...>SomeContent</Button>, as that would override the “placeholder content” from the Style.