iam trying to upload some file on a server and i did it async it works just fine but i want to show the progress of the uploading on progress bar that i embed in a listview using this thread
i update the progress bar value on event progresschanged that i create for uploading this is the code am using
UploaderService ser =
new
UploaderService();
radListView1.Items.Add(
"1"
,
"Test Video"
,
""
,
""
, 0,
""
);
ser.Authenticate(
"username"
,
"password"
);
Uploader up =
new
Uploader(ser, @
"C:\Users\public\Downloads\Video\E"
);
up.ProgressChanged += ((ss, rr) =>
{
var PercentComplete = (rr.Progress * 100.0f) / up.Size;
radListView1.Items[0][4] = Convert.ToInt32(PercentComplete);
});
also i found a workaround but theres any other way withou making a loop while
while
(
true
)
{
var PercentComplete = (up.Progress * 100.0f) / up.Size;
radListView1.Items[0][4] = Convert.ToInt32(PercentComplete);
radListView1.RootElement.UpdateLayout();
radListView1.Refresh();
if
(PercentComplete == 100)
{
break
;
}
}