I'm having an issue on a C# WPF code : I have multiple colored images on a window and when I click on it, it becomes blurred (this works). But my code is really bad optimized and I would like to get some help !
Here's a small part of my code :
private void BrownBlur(object sender, MouseButtonEventArgs e)
{
Brown.BlurApply(blurRadius: 15, new TimeSpan(0, 0, 1), TimeSpan.Zero);
}
private void LightGreenBlur(object sender, MouseButtonEventArgs e)
{
LightGreen.BlurApply(blurRadius: 15, new TimeSpan(0, 0, 1), TimeSpan.Zero);
}
And it goes like this for every color of the window...
I know that this is probably the worst way to code something, so I tried things like this :
private void isBlurred()
{
this.BlurApply(blurRadius: 15, new TimeSpan(0, 0, 1), TimeSpan.Zero);
}
But this is the whole window that becomes blurred...
So I'm asking you guys if you know an alternative to "this.BlurApply" or if you know a way to create a variable which changes in function of the clicked item !