开发者

UserControl's Item's background

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜