Silverlight 4 Quick Tip: Styling application

Wednesday, November 18, 2009

Silverlight 4 supports default styles. Default styles are styles with TargetType, but without x:Key property set. Those styles will be applied to all controls from corresponding type. The sample of default (also sometime called anonymous) style: <Style TargetType="Button"> <Setter Property="Margin" Value="5"/> <Setter Property="Width" Value="100"/> <Setter Property="Height" Value="25"/> <Setter Property="Background" Value="Red"/> </Style> This style will be applied on any button in the scope of the style. If this style will be placed...

Silverlight 3 Quick Tip #10: Styling Improvements

Monday, June 22, 2009

Silverlight 3 bring long-awaited improvements in styling mechanism: “BasedOn” mechanism, Merged Resource Dictionaries and eliminates “write once” style setting behavior. Let’s see those features. BasedOn Styles can be “derived” from one another. Perfect for cascading/inheriting styles. Let’s define style for a… Button (well, in demos it is always a Button, TextBox, etc. ;)) <Style x:Key="BaseButtonStyle" TargetType="ButtonBase"> <Setter Property="Width" Value="100"/> <Setter Property="Height" Value="25"/> <Setter Property="Margin" Value="5"/> </Style> To “derive” from existing style we should specify BasedOn property <Style x:Key="DerivedButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource BaseButtonStyle}"> ...

What’s new in Silverlight 3 Beta 1?

Wednesday, March 18, 2009

As just announced at MIX09 keynotes, new version of Silverlight will hit our machines – this time it will be Silverlight 3 Beta 1. Here is the short list of what’s new in there: Go offline with your application: Silverlight 3 provides all the features you need to store your application on your users machine, and then work against their data in the your isolated cache or under their MyDocuments. Your application can ask the user if they want to add a link to your application on their desktop or start menu. In addition, you can check...

Silverlight 2 Metro Training Event in Mumbai

Thursday, February 26, 2009

I’m doing a Silverlight 2 Training for MS Metro program in Mumbai. Thanks for all participants in this event. Hope you enjoyed the course as much as I enjoyed doing it. As promised the selected samples from this event could be found here. Samples updated…   Thanks and Enjoy the samples Alex

Quick Silverlight Tip: Define control style dynamically

Tuesday, September 9, 2008

Lately I've been asked a couple of time by client how to provide certain level of customization for their Silverlight application. In many cases they want to provide their client with ability to change styles/templates in application or part of it. Another common request, is to provide an ability to use external style definitions. Here the quick tip on how it could be achieved. I'll build really simple solution, which uses WebService to provide external style definition as loose XAML file and will apply it to XAML object. Also, my simple solution will receive some style definition as a...