Styles in Silverlight 3.0 can now be modified at runtime and support inheritance.
The following code shows how to apply a style to a button at runtime:
myButton.Style=(Style)Application.Current.Resources["MyHorridFuchsiaStyle"];
Silverlight 3.0 allows you to create styles that inherit from another style (sort of like CSS) by specifying a parent style in the BasedOn property. The following code creates a style inheriting from MyHorridFuchsiaStyle:
<Style x:Key="HybridStyle" TargetType="Button" BasedOn="{StaticResource MyHorridFuchsiaStyle}"></Style>
It is now possible to refer to external resource dictionary files within your application:
<ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="myExternalResources.xaml" /> </ResourceDictionary.MergedDictionaries> </ResourceDictionary>
3.135.201.52