private static void OnAlphaPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { PointerPositionSpotLight l = d as PointerPositionSpotLight; if (l?._Light != null) { byte alpha = e.NewValue.To <byte>(); Color color = l._Light.InnerConeColor; color.A = alpha; l._Light.InnerConeColor = l._Light.OuterConeColor = color; } }
private static void OnShadePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { PointerPositionSpotLight l = d as PointerPositionSpotLight; if (l?._Light != null) { byte shade = e.NewValue.To <byte>(); Color color = new Color { A = l.Alpha, R = shade, G = shade, B = shade }; l._Light.InnerConeColor = l._Light.OuterConeColor = color; } }