void OnProcessButtonClicked(object sender, EventArgs e) { (sender as Button).IsEnabled = false; pixmap = image.FrequencyFilter((int)minSlider.Value, (int)maxSlider.Value); canvasView.InvalidateSurface(); (sender as Button).IsEnabled = true; }