Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Your <code>Button</code> will automatically stretch to fit the size of it's contents, so get rid of it's <code>Height</code> and <code>Width</code> properties. If you want to maintain the space between the edge of the Button and the ContentControl, use the ContentControl's <code>Margin</code> property.</p> <p>Then, use a <code>DataTrigger</code> in your ContentControl's <code>Style</code> to change the <code>Height</code>/<code>Width</code> when the mouse is over it. Be sure you set <code>Height</code>/<code>Width</code> in your style instead of in your <code>&lt;ContentControl&gt;</code> tag, because if you set it in the tag it will take precedence over the triggered value so will never change.</p> <pre><code>&lt;Style x:Key="MyContentControlStyle" TargetType="{x:Type ContentControl}"&gt; &lt;Setter Property="Height" Value="20" /&gt; &lt;Setter Property="Width" Value="20" /&gt; &lt;Setter Property="Margin" Value="5" /&gt; &lt;Setter Property="Content" Value="ContentControl" /&gt; &lt;Setter Property="Template" Value="{DynamicResource contentTemplate}" /&gt; &lt;Style.Triggers&gt; &lt;DataTrigger Binding="{Binding ElementName=btnAddItem, Path=IsMouseOver}" Value="True"&gt; &lt;Setter Property="Height" Value="20" /&gt; &lt;Setter Property="Width" Value="20" /&gt; &lt;/DataTrigger &gt; &lt;/Style.Triggers&gt; &lt;/Style&gt; &lt;Button x:Name="btnAddItem" Height="25" Width="25" Margin="5,0,0,0" Style="{DynamicResource btnStyle}" ToolTip="Add Item"&gt; &lt;ContentControl Style="{StaticResource MyContentControlStyle}" /&gt; &lt;/Button&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.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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