private void OnThumbTintChanged(Brush newValue) { if (newValue is SolidColorBrush asColorBrush) { ThumbDrawable?.SetColorFilter(asColorBrush.Color, PorterDuff.Mode.SrcIn); } }
private void OnThumbTintChanged(Brush newValue) { if (newValue is SolidColorBrush asColorBrush) { #if __ANDROID_28__ #pragma warning disable 618 // SetColorFilter is deprecated ThumbDrawable?.SetColorFilter(asColorBrush.ColorWithOpacity, PorterDuff.Mode.SrcIn); #pragma warning restore 618 // SetColorFilter is deprecated #else ThumbDrawable?.SetColorFilter(new BlendModeColorFilter(asColorBrush.ColorWithOpacity, BlendMode.SrcIn)); #endif } }