I have the following Style for a Button which is supposed to grow to 1.5 times the size when the mouse hovers it. The problem is that Button grows from the Top-Left corner inste
You can set RenderTransformOrigin
to "0.5, 0.5"
<Style x:Key="sizeButton" TargetType="Button">
<Setter Property="RenderTransformOrigin" Value="0.5, 0.5"/>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="RenderTransform">
<Setter.Value>
<ScaleTransform ScaleX="1.5" ScaleY="1.5"/>
</Setter.Value>
</Setter>
</Trigger>
</Style.Triggers>
</Style>
ScaleTransform.CenterX and ScaleTransform.CenterY are not values between [0, 1], rather they should be absolute pixel values.
<ScaleTransform CenterX="50" CenterY="25" ScaleX="1.5" ScaleY="1.5"/>