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.
精彩评论