Matt
Matt

Reputation: 1582

CSS styles in Silverlight

I know styling is possible in SL, but I have a large web app that has both HTML and SL so it would be really useful if they could use the same style sheet... Is it possible? Thanks.

Upvotes: 3

Views: 1505

Answers (3)

felixthehat
felixthehat

Reputation: 847

CSS and XAML are incompatible sadly. In Silverlight 'Stylesheets' are called ResourceDictionaries, which live in the Silverlight Project.

I created a free Silverlight theme which has several ResourceDictionaries, one for the colours (Brushes.xaml) and one to style the controls, it might be worth downloading the project to see how it works: http://www.blackspike.com/site/silverlight/free-silverlight-4-beta-skin

Upvotes: 0

SpliFF
SpliFF

Reputation: 38976

I would have to say no. If for no other reason than Microsoft's poor track record in regards to CSS (even their leading browser generation is 10 years behind competing CSS implementations). The Word/Outlook engine is atrocious at CSS. If silverlight supports CSS you can bet it'll be a dog's breakfast.

On the other hand SVG supports CSS so you might want to look into that as an alternative.

Upvotes: 2

Neil Knight
Neil Knight

Reputation: 48547

Silverlight is a Web application and not a Web form. You'd have to use the Resource.XAML file in order to apply styling to your Silverlight application.

Upvotes: 0

Related Questions