AsyncImageAndroid.MainActivity.DownloadAsync C# (CSharp) Method

DownloadAsync() private method

private DownloadAsync ( object sender, EventArgs args ) : void
sender object
args System.EventArgs
return void
		async void DownloadAsync(object sender, EventArgs args)
		{
			clickButton.Click += manager.EventHandler;

			SetDownloading ();

			string filePath = string.Empty;
			try {
				filePath = await manager.DownloadAsync(downloadUrl, "downloaded.png");
			} catch(TaskCanceledException) {
				Console.WriteLine ("Task Canceled!");
				SetReadyToDownload ();
				return;
			} catch(Exception exc) {
				Console.WriteLine (exc);
				SetReadyToDownload ();
				return;
			}

			infoLabel.Text = "Resizing Image...";

			var bitmap = await FetchBitmap (filePath);
			imageview.SetImageBitmap (bitmap);
			SetReadyToDownload ();

			// Solution is here
			clickButton.Click -= manager.EventHandler;
		}