开发者

datatrigger causing button to be misaligned

开发者 https://www.devze.com 2023-02-15 22:25 出处:网络
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.

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

精彩评论

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