Click here to Skip to main content
13,146,934 members (80,429 online)
Click here to Skip to main content
Add your own
alternative version


15 bookmarked
Posted 28 Apr 2010

[Performance tips] Use the system shadows instead of your own

, 22 Sep 2010
Rate this:
Please Sign up or sign in to vote.
A fast and easy tip about shadows and performance

Today, I am going to give you a fast and easy tip about shadows and performance.

In a project I recently made, we told the designer not to use BitmapEffects because they are performance killers. He decided to create its own shadows by duplicating each shape and make them look like shadows (designer magic, voodoo things, etc...). I was then surprised to see that it kills performance too!

There is still the shaders effect which came with the 3.5 SP1 framework but they will be available only on Vista or greater platforms and their performance will depend on your graphic cards.

But we have another ace in our deck: the system shadow which is quite fast even on software rendering!

Using it is quite easy:

  1. Add the PresentationFramework.Aero reference to your project
  2. Add the following XML namespace:
  3. Use the SystemDropShadowChrome element available with this namespace!

But there is a drawback: you can only produce squared shadows. However, you can still play with the CornerRadius property to create similarly round shadows.

Here is a small example of XAML code:



  <shadows:SystemDropShadowChrome Margin="25">
      <ListBoxItem Content="One item" />
      <ListBoxItem Content="Another item" />
      <ListBoxItem Content="Another third item" />
  </shadows:SystemDropShadowChrome >
  <shadows:SystemDropShadowChrome Margin="25" 

	CornerRadius="800" Width="100" Height="100">
    <Ellipse Stroke="Black" Fill="White" />

Shadows screenshot

Shout it kick it on


This article, along with any associated source code and files, is licensed under The Microsoft Public License (Ms-PL)


About the Author

Software Developer
France (Metropolitan) France (Metropolitan)
Jonathan creates software, mostly with C#,WPF and XAML.

He really likes to works on every Natural User Interfaces(NUI : multitouch, touchless, etc...) issues.

He is awarded Microsoft MVP in the "Client Application Development" section since 2011.

You can check out his WPF/C#/NUI/3D blog

He is also the creator of the WPF French community web site :

Here is some videos of the projects he has already work on :

You may also be interested in...


Comments and Discussions

GeneralMy vote of 5 Pin
maq_rohit22-Sep-10 4:10
membermaq_rohit22-Sep-10 4:10 
GeneralMy vote of 5 Pin
CIDev22-Sep-10 3:02
memberCIDev22-Sep-10 3:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.170915.1 | Last Updated 22 Sep 2010
Article Copyright 2010 by jmix90
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid