As many of you are aware we've just released a new version of the Silverlight Toolkit. Rest assured it is a high-quality release that is chock full of great new controls and compelling features. Unfortunately a bug in the SL3 version of ISM slipped through. This bug causes ISM to replace styles you've explicitly set. This issue also affects the themes.
Given the following XAML...
<Grid theming:ImplicitStyleManager.ApplyMode="Auto"> <Grid.Resources> <Style TargetType="Button"> <Setter Property="Foreground" Value="Green" /> </Style> <Style x:Key="customStyle" TargetType="Button"> <Setter Property="Foreground" Value="Red" /> </Style> </Grid.Resources> <Button Content="This should be red." Style="{StaticResource customStyle}" /> </Grid>
...ISM should ensure that the style explicitly set on the button takes precedence over the other style in the Grid's resource dictionary. Unfortunately it replaces the explicit style with the implicit one:
The good news is that you can replace the references to the System.Windows.Controls.Theming.*.dlls in the Silverlight 3 Toolkit with the ones in the newest version of the Silveright 2 Toolkit (available here) and everything will work just fine. You will still get access to all the new themes and bug fixes. In fact there is no difference between these two assemblies other than this bug.
Sorry for the inconvenience.
This comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDelete