initial
This commit is contained in:
41
Converter/BlurEffectConverter.cs
Normal file
41
Converter/BlurEffectConverter.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Markup;
|
||||
using System.Windows.Media.Effects;
|
||||
|
||||
namespace C4IT_CustomerPanel.Converter
|
||||
{
|
||||
public class BooleanToBlurEffectConverter : MarkupExtension, IValueConverter
|
||||
{
|
||||
public double Radius { get; set; } = 5;
|
||||
|
||||
public object Convert(
|
||||
object value, Type targetType, object parameter,
|
||||
CultureInfo culture)
|
||||
{
|
||||
if (!(value is bool))
|
||||
return null;
|
||||
|
||||
return (bool)value ? new BlurEffect() { Radius = Radius, KernelType = KernelType.Gaussian } :
|
||||
null;
|
||||
}
|
||||
|
||||
public object ConvertBack(
|
||||
object value, Type targetType, object parameter,
|
||||
CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override object ProvideValue(IServiceProvider serviceProvider)
|
||||
{
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user