开发者

Silverlight: how to you override part of a theme's style

开发者 https://www.devze.com 2022-12-28 16:37 出处:网络
I am using themes from the Silverlight toolkit, however several of them have po开发者_运维问答or readonly textbox styles (i.e. there is no visual representation when the textbox\'s are readonly.

I am using themes from the Silverlight toolkit, however several of them have po开发者_运维问答or readonly textbox styles (i.e. there is no visual representation when the textbox's are readonly.

How can I use the themes, but tweak a textbox readonly style? (Because I am extensivly using the dataform this can only apply when the textbox is readony)


Easy enough in Silverlight 4 (once I got a little more familer with styling.

 <df:DataForm.ReadOnlyTemplate>
        <DataTemplate>
            <StackPanel Name="rootPanel" 
                        Orientation="Vertical">
                <StackPanel.Resources>
                    <Style TargetType="TextBox">
                        <Setter Property="Foreground" Value="LightGray" ></Setter>
                        <Setter Property="Background" Value="Red" ></Setter>
                    </Style>


You'd need to start with the XAML and use it (implicit style support is built into Silverlight 4 now), or otherwise rebuild starting with the Toolkit theme you like.

0

精彩评论

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

关注公众号