开发者

datatrigger causing button to be misaligned

When I remove this style from a button it displays properly. When I don't, it pushes all the other 开发者_C百科buttons in the row down by approx 5 pixels.

<Button.Style>
    <Style TargetType="Button">
        <Style.Triggers>
            <DataTrigger Binding="{Binding CanUserUpdateHosts}" Value="True">
                <Setter Property="IsEnabled" Value="False"/>
            </DataTrigger>
        </Style.Triggers>
    </Style>
</Button.Style>


If you have any implicit Styles defined for Buttons, then they will be ignored if you set the Button.Style property explicitly. So chances are you are short-circuiting another Style.

Default Styles on the other hand will still be applied.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜