Skip to Content
Introducing .NET 4.0: with Visual Studio 2010
book

Introducing .NET 4.0: with Visual Studio 2010

by Alex Mackey
February 2010
Beginner content levelBeginner
400 pages
11h 13m
English
Apress
Content preview from Introducing .NET 4.0: with Visual Studio 2010

15.11. Styles

Styles in Silverlight 3.0 can now be modified at runtime and support inheritance.

15.11.1. Applying Styles Dynamically

The following code shows how to apply a style to a button at runtime:

myButton.Style=(Style)Application.Current.Resources["MyHorridFuchsiaStyle"];

15.11.2. Style Inheritance

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>

15.11.3. Merge Dictionary Support

It is now possible to refer to external resource dictionary files within your application: ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

ASP.NET 3.5 For Dummies®

ASP.NET 3.5 For Dummies®

Ken Cox
ASP.NET 4 Unleashed

ASP.NET 4 Unleashed

Stephen Walther, Kevin Hoffman, Nate Dudek

Publisher Resources

ISBN: 9781430224556Purchase book