protected void TransferProgressChanged(object sender, TransferEventArgs e) { this.Progress = (int)(e.Request.BytesReceived * 100 / e.Request.TotalBytesToReceive); }
protected async void TransferStatusChanged(object sender, TransferEventArgs e) { UpdateDownloadStatus(e.Request.TransferStatus); if (e.Request.TransferStatus == FileTransferStatus.Completed) { await FinishDownload(); QuranApp.NativeProvider.DownloadManager.FinalizeRequest(e.Request); if (DownloadComplete != null) DownloadComplete(this, null); } if (e.Request.TransferStatus == FileTransferStatus.Cancelled) { await FinishDownload(); QuranApp.NativeProvider.DownloadManager.FinalizeRequest(e.Request); if (DownloadCancelled != null) DownloadCancelled(this, null); } }