示例#1
0
 public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
 {
     if (value != null && value.GetType() == typeof(ImageFrameModel.Shadow))
     {
         ImageFrameModel.Shadow shadow = (ImageFrameModel.Shadow)value;
         if (shadow.Enabled)
         {
             return(shadow.Opacity);
         }
         else
         {
             return(0);
         }
     }
     return(Binding.DoNothing);
 }
 public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
 {
     if (value != null && value.GetType() == typeof(ImageFrameModel.Shadow))
     {
         ImageFrameModel.Shadow shadow = (ImageFrameModel.Shadow)value;
         if (shadow.Enabled)
         {
             return(new DropShadowEffect()
             {
                 Opacity = shadow.Opacity,
                 ShadowDepth = shadow.Depth,
                 Direction = shadow.Direction,
                 BlurRadius = shadow.BlurRadius,
                 Color = Colors.Black
             });
         }
         else
         {
             return(null);
         }
     }
     return(Binding.DoNothing);
 }