Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Edit the Template (use Blend or if if you don't have blend do it this way: <a href="https://stackoverflow.com/questions/7143698/net-4-control-default-templates-without-blend">.NET 4 control default templates without Blend</a>)</p> <p>This is the default control template part of the ribbon button style:</p> <pre><code> &lt;ControlTemplate TargetType="{x:Type ribbon:RibbonButton}"&gt; &lt;Border x:Name="OuterBorder" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="{TemplateBinding CornerRadius}" SnapsToDevicePixels="True"&gt; &lt;Border x:Name="InnerBorder" BorderBrush="Transparent" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding CornerRadius}" Padding="{TemplateBinding Padding}"&gt; &lt;StackPanel x:Name="StackPanel"&gt; &lt;Image x:Name="PART_Image" RenderOptions.BitmapScalingMode="NearestNeighbor" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Height="32" Margin="{DynamicResource {ComponentResourceKey ResourceId=LargeImageMargin, TypeInTargetAssembly={x:Type ribbon:Ribbon}}}" Source="{TemplateBinding LargeImageSource}" VerticalAlignment="Center" Width="32"/&gt; &lt;Grid x:Name="Grid" HorizontalAlignment="Center" VerticalAlignment="Center"&gt; &lt;ribbon:RibbonTwoLineText x:Name="TwoLineText" HorizontalAlignment="Center" LineStackingStrategy="BlockLineHeight" LineHeight="13" Margin="1,1,1,0" TextAlignment="Center" Text="{TemplateBinding Label}" VerticalAlignment="Top"/&gt; &lt;/Grid&gt; &lt;/StackPanel&gt; &lt;/Border&gt; &lt;/Border&gt; </code></pre> <p>Change this to your needs, you could for example adjust the width and height of the image to the surrounding Border:</p> <pre><code> &lt;ControlTemplate TargetType="{x:Type ribbon:RibbonButton}"&gt; &lt;Border x:Name="OuterBorder" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="{TemplateBinding CornerRadius}" SnapsToDevicePixels="True"&gt; &lt;Border x:Name="InnerBorder" BorderBrush="Transparent" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding CornerRadius}" Padding="{TemplateBinding Padding}"&gt; &lt;StackPanel x:Name="StackPanel"&gt; &lt;Image x:Name="PART_Image" RenderOptions.BitmapScalingMode="NearestNeighbor" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Stretch="Fill" Height="{Binding ElementName=InnerBorder, Path=ActualHeight}" Margin="{DynamicResource {ComponentResourceKey ResourceId=LargeImageMargin, TypeInTargetAssembly={x:Type ribbon:Ribbon}}}" Source="{TemplateBinding LargeImageSource}" VerticalAlignment="Center" /&gt; &lt;Grid x:Name="Grid" HorizontalAlignment="Center" VerticalAlignment="Center"&gt; &lt;ribbon:RibbonTwoLineText x:Name="TwoLineText" HorizontalAlignment="Center" LineStackingStrategy="BlockLineHeight" LineHeight="13" Margin="1,1,1,0" TextAlignment="Center" Text="{TemplateBinding Label}" VerticalAlignment="Top"/&gt; &lt;/Grid&gt; &lt;/StackPanel&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload