Click here to Skip to main content
15,880,543 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi, I am trying to bind a color to a drop shadow effect using a converter class.

< dropshadoweffect x:key="DropShadow" color="{Binding ScoreBrush, Converter={StaticResource ColorSelector}}" blurradius="150" shadowdepth="0" />

that is what I did, But it is leaving it as default. This exact way works on other colors e.g background color.

Could someone please explain why this is?
Posted
Updated 3-Apr-14 23:50pm
v3

1 solution

You should return a Color object from the Converter class something like this
C#
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
           {
               if (value is string)
               {
                   return Colors.Yellow;
               }
               return Colors.Black;
           }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900