We use own styled image buttons. On our developer computer (all Win 7 x64 VS 2013) works all well. Also on customer computers with Win7 x64 .Net 4.5.x.
On the test computer with Win 7 x32 .Net 4.0 the image buttons have the standard style of the button, not the new style. On Win 7 x32 with .Net 4.5 it works. So I think the problem is in the .Net version rather than x32 Architecture.
Our style for the image buttons
<!-- Default Template -->
<Style TargetType="{x:Type con:PreparedImageButton}" BasedOn="{x:Null}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type con:PreparedImageButton}">
<Border
x:Name="_PART_BORDER"
CornerRadius="0"
BorderThickness="0"
Width="{TemplateBinding Width}"
Height="{TemplateBinding Height}"
Padding="{TemplateBinding Padding}"
Background="{DynamicResource DefaultBackground}">
<Viewbox Stretch="Uniform">
<ContentPresenter x:Name="_PART_SIGN" Content="{x:Null}" />
</Viewbox>
</Border>
<ControlTemplate.Triggers>
<!-- Background Trigger -->
<!-- Disabled Background -->
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="_PART_BORDER" Property="Background"
Value="{DynamicResource DisabledBackground}" />
</Trigger>
<Trigger Property="IsEnabled" Value="True">
<Setter Property="Cursor" Value="Hand" />
</Trigger>
<!-- Pushed Background -->
<Trigger Property="IsPressed" Value="True">
<Setter TargetName="_PART_BORDER" Property="Background"
Value="{DynamicResource PushedBackground}" />
</Trigger>
<!-- Button Type Trigger -->
<!-- Next -->
<Trigger Property="ButtonType" Value="Next">
<Setter TargetName="_PART_SIGN" Property="Content" Value="{DynamicResource NextSignCanvas}" />
</Trigger>
<!-- Back -->
<Trigger Property="ButtonType" Value="Previous">
<Setter TargetName="_PART_SIGN" Property="Content" Value="{DynamicResource BackSignCanvas}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
In the most cases we use DataTemplate for our ViewModel
<!-- Default ViewModel Template -->
<DataTemplate DataType="{x:Type vm:PreparedImageButtonViewModel}">
<con:PreparedImageButton ButtonType="{Binding ButtonType}"
IsVikingStyle="{Binding IsVikingStyle}"
Command="{Binding Command}"
IsEnabled="{Binding IsEnabled}"
Visibility="{Binding IsVisible, Converter={StaticResource BooleanVisibilityConverter}}"
IsCancel="{Binding IsCancel}"
IsDefault="{Binding IsDefault}"
ToolTip="{Binding ToolTip}"
Width="{DynamicResource DefaultButtonHeight}"
Padding="{DynamicResource DefaultSignPadding}"
Height="{DynamicResource DefaultButtonHeight}" />
</DataTemplate>
And in the Window / User controls we bind this buttons over ContentControl:
<ContentControl Content="{Binding ProtocolButton}" Margin="0,0,5,0" HorizontalAlignment="Right" />
Any idea what's going wrong with .Net 4.0?
Win7 x32 .Net 4.0
Win7 x64 .Net 4.5
Edit
It seems that .Net 4.0 is not able to resolve merged dictionaries correctly. Normally we merge external dictionaries in the Global.xaml of the current project.
If we do this with the image button, it doesn't work. If we merge the dictionary of the image button direct in the Windows/UserControl, where we use them, this works (under .Net 4.0).
For all other controls of us, merging works without problems.
We test now, if the problem is there, if we build the solution on the computer with only .Net 4.0 and VS2010.