开发者

UserControl's Item's background

开发者 https://www.devze.com 2023-02-15 03:37 出处:网络
I have a user control with few elements inside, one of the element I want to set it\'s background to Transparent, but I dont want the user of this control to be able to change it using Styles.

I have a user control with few elements inside, one of the element I want to set it's background to Transparent, but I dont want the user of this control to be able to change it using Styles.

: 开发者_运维百科for example

<Trigger Property="IsEnabled" Value="false">
            <Setter Property="Background" Value="{StaticResource DisabledBackground}" />
            <Setter Property="Foreground" Value="{StaticResource DisabledForeground}" />
        </Trigger>

this code sets the background of the entire control (including the item I dont want to change).

Any Ideas ?


Can't you just set the background of the control explicitly to transparent? That should override any inherited styles.

0

精彩评论

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

关注公众号