2

When I set Height or Width, the transitions do not work;

<Style Selector="lib|BarButtonItem.ImageButtonStyle">
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="Width" Value="16" />
        <Setter Property="Height" Value="16" />
        <Setter Property="Template">
            <ControlTemplate>
                <Grid>
                    <Border Name="Border" 
                            Width="{TemplateBinding Width}" 
                            Height="{TemplateBinding Height}" />
                    <Image Source="{TemplateBinding ImageSource}" 
                           ToolTip.Tip="{TemplateBinding Tip}" 
                           Width="{TemplateBinding Width}"
                           Height="{TemplateBinding Height}" />
                </Grid>
            </ControlTemplate>
        </Setter>
        <Setter Property="Transitions">
            <Transitions>
                <DoubleTransition Property="Width" Duration="0:0:0.2" />
                <DoubleTransition Property="Height" Duration="0:0:0.2"/>
            </Transitions>
        </Setter>
    </Style>

    <Style Selector="lib|BarButtonItem.ImageButtonStyle:pointerover">
        <Setter Property="Width" Value="20" />
        <Setter Property="Height" Value="20" />
    </Style>

I set width to 20, height to 20, it`s width or height not change when mouse in BarButtonItem

Layer
  • 53
  • 2

0 Answers0