示例#1
0
        public async Task UploadFile(string filePath)
        {
            var fileUpload = new FileUpload()
            {
                FilePath = filePath
            };

            FileUploads.Add(fileUpload);
            await _fileTransferService.UploadFile(fileUpload, _viewer);
        }
示例#2
0
        public async Task UploadFile(string filePath)
        {
            var fileUpload = new FileUpload()
            {
                FilePath = filePath
            };

            App.Current.Dispatcher.Invoke(() =>
            {
                FileUploads.Add(fileUpload);
            });

            await _fileTransferService.UploadFile(fileUpload, _viewer, (double progress) =>
            {
                App.Current.Dispatcher.Invoke(() => fileUpload.PercentProgress = progress);
            });
        }