public void StartDownload(string saveLocation)
 {
     try
     {
         PrepareToDownload();
         if (!IsStatusCorrect())
         {
             AfterDownload.Execute();
             return;
         }
         ProcessFileLocation(saveLocation);
         _time = DateTime.Now;
         using (var wc = new WebClient())
         {
             Status = DownloadStatus.Downloading;
             wc.DownloadProgressChanged += OnDownloadProgressChanged;
             wc.DownloadFileCompleted   += OnDownloadFileCompleted;
             wc.DownloadFileAsync(new Uri(DownloadLink), FileLocation);
             wc.Proxy = null;
             OnPropertyChanged(nameof(Status));
         }
     }
     catch (Exception ex)
     {
         Status = DownloadStatus.Error;
         Log.Debug("Error while starting a download process.", ex);
         Log.Debug(ToString());
     }
 }
 private void OnDownloadFileCompleted(object sender, AsyncCompletedEventArgs e)
 {
     if (e.Error != null)
     {
         Status          = DownloadStatus.Error;
         DownloadPercent = 0;
         Log.Debug("Error while downloading", e.Error);
         Log.Debug(ToString());
     }
     else if (e.Cancelled)
     {
         Status          = DownloadStatus.Canceled;
         DownloadPercent = 0;
         Log.Debug("Download has been canceld.");
         Log.Debug(ToString());
     }
     else
     {
         CheckIfFileIsDownloadedSuccesful();
     }
     OnPropertyChanged(nameof(DownloadPercent));
     OnPropertyChanged(nameof(Status));
     AfterDownload.Execute();
 }