This sounds like a job for Attached properties.
Create a utility class with you "placeholder properties":
public static class BigButtonUtils
{
public static Uri GetBBImage(DependencyObject obj)
{
return (Uri)obj.GetValue(BBImageProperty);
}
public static void SetBBImage(DependencyObject obj, Uri value)
{
obj.SetValue(BBImageProperty, value);
}
// Using a DependencyProperty as the backing store for BBImage. This enables animation, styling, binding, etc...
public static readonly DependencyProperty BBImageProperty =
DependencyProperty.RegisterAttached("BBImage", typeof(Uri), typeof(BigButtonUtils), new UIPropertyMetadata(null));
public static string GetBBCaption(DependencyObject obj)
{
return (string)obj.GetValue(BBCaptionProperty);
}
public static void SetBBCaption(DependencyObject obj, string value)
{
obj.SetValue(BBCaptionProperty, value);
}
// Using a DependencyProperty as the backing store for BBCaption. This enables animation, styling, binding, etc...
public static readonly DependencyProperty BBCaptionProperty =
DependencyProperty.RegisterAttached("BBCaption", typeof(string), typeof(BigButtonUtils), new UIPropertyMetadata(null));
}
Apply those properties on a Button..
<Button Style="{StaticResource BigButtonStyle}"
bb:BigButtonUtils.BBImage="http://programming.enthuses.me/1.png"
bb:BigButtonUtils.BBCaption="My caption" />
..and use the property values in your Style:
<Style x:Key="BigButtonStyle" 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 DataContext="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=Button}}">
<Image Source="{Binding Path=(bb:BigButtonUtils.BBImage)}" Stretch="None" />
<TextBlock Text="{Binding Path=(bb:BigButtonUtils.BBCaption)}" />
</StackPanel>
</Setter.Value>
</Setter>
</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.