Silverlight 3 Quick Tip #7: System Colors - DevCorner

Silverlight 3 Quick Tip #7: System Colors

Silverlight 3 now supports operating system colors. This means, that now Silverlight 3 applications could be adopted for users who use high-contrast color schemes.

The usage is very simple – in System.Windows namespace exists new static class “SystemColors” with colors definitions. Those colors could be use as a Color in any brushes.

The sample code is very short this time:

Rectangle activeBorderColor = new Rectangle();
activeBorderColor.Fill = new SolidColorBrush(System.Windows.SystemColors.ActiveBorderColor);

 

Here is sample application running standard Vista Aero color scheme:

image

after changing color scheme to high-contrast the same applications looks like follows:

image 

 

 

Enjoy,

Alex

Published Sunday, April 12, 2009 8:58 AM by Alex Golesh

Comments

# Silverlight网络寻奇 at 090417

Silverlight改变Ie外观

blogs.microsoft.co.il/.../silverlight-3-q...

Friday, April 17, 2009 6:46 AM by nasa

# Silverlight网络寻奇 at 090417

Silverlight改变Ie外观

blogs.microsoft.co.il/.../silverlight-3-q...

Friday, April 17, 2009 6:49 AM by nasa

# re: Silverlight 3 Quick Tip #7: System Colors

Great thing ! But what about XAML ? Is it possible in a simple way ?

Saturday, September 19, 2009 11:38 AM by Necriis

# re: Silverlight 3 Quick Tip #7: System Colors

Necriis: Sure, only add a relevant namespace...

Alex

Monday, September 21, 2009 11:15 AM by Alex Golesh

Leave a Comment

(required) 
(required) 
(optional)
(required) 

Enter the numbers above: