void OnProcessButtonClicked(object sender, EventArgs e) { (sender as Button).IsEnabled = false; switch (picker.SelectedIndex) { case 0: pixmap = image.WaveletUpscale(Wavelet.Haar); break; case 1: pixmap = image.WaveletUpscale(Wavelet.Biorthogonal53); break; } canvasView.InvalidateSurface(); (sender as Button).IsEnabled = true; }