Closed Vijay-Nirmal closed 3 years ago
Hi @Vijay-Nirmal thank you for the suggestion. To gauge wider interest, can you please create a uservoice entry with as much detail as possible ?
Hey @Vijay-Nirmal, what benefits would this helper provide over the BackgroundDownloader?
@nmetulev Does BackgroundDownloader
have are the features I mentioned in my post? Also, this helper makes it easy to create controls for downloading like the example below
<TextBlock Text="{x:Bind downloader.GetSpeed}"/> //To display speed
<ProgressBar Value="{x:Bind downloader.GetPercentage}"/> //To display Progress Bar for downloading
This helper should have built in INotifyPropertyChanged
So basically a wrapper around DownloadOperation?
@nmetulev I think so. This helper will help to implement all the basic functions (Like Start, Stop, Pause, get speed, setting the speed limit, downloading multiple files, name and size of the downloading item) very easily. I don't think it will be a duplicate of DownloadOperation
@Vijay-Nirmal Seems interesting if you can also create a page example that can easily be replicated in any app.
@Odonno I didn't get your point but sounds good to me :) What do you mean by "page example"?
@Vijay-Nirmal A page with some UI controls demonstrating the download of a file. And, another question, if it works with Download, can it work with Upload?
@Odonno
if it works with Download, can it work with Upload?
That is a good point. I love to see that. If we do this then we should change the name of the helper :)
From the design point of view. How can we make it easy to create a ListView like Windows Store?
private ObservableCollection<DownloadsItem> DownloadsItemSource = new ObservableCollection<DownloadsItem>();
public class DownloadsItem
{
public BitmapImage Logo { get; set; }
public Downloader downloader { get; set; }
}
<Page.Resources>
<converters:BoolToObjectConverter x:Key="BoolToIconConverter" TrueValue="" FalseValue="" />
</Page.Resources>
<ListView ItemsSource="{x:Bind DownloadsItemSource}">
<ListView.ItemTemplate>
<DataTemplate x:DataType="local:DownloadsItem">
<StackPanel Orientation="Horizontal">
<Image Name="DownloadLogo" Source="{x:Bind Logo}"/>
<TextBlock Name="DownloadName" Text="{x:Bind downloader.GetInfo.Name}"/>
<StackPanel>
<TextBlock Name="Downloaded" Text="{x:Bind downloader.Downloaded}"/>
<ProgressBar Name="DownloadProgressBar" Value="{x:Bind GetPercentage}"/>
<TextBlock Name="DownloadSpeed" Text="{x:Bind downloader.GetSpeed}"/>
</StackPanel>
<Button Name="StartPause" FontFamily="Segoe MDL2 Assets" Content="{x:Bind Path=downloader.IsPaused, Converter={StaticResource BoolToBrushConverter}}"/>
<Button Name="Cancel" FontFamily="Segoe MDL2 Assets" Content=""/>
</StackPanel>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
This method contains few problems.
@Vijay-Nirmal uploading is a very different ball game
@hermitdave But it will also have the sample controls like start, pause, cancel, ProgressBar
I am not sure if it's the best solution but we can create a DownloadItem or DownloadItemNotification class which contains a boolean (IsRunning) and an integer value (Percentage, from 0 to 100). These properties should be updated using INotifyPropertyChanged.
Of course, you can add Speed as a third notifiable property.
@Odonno What would be the best solution to start, pause, stop, cancel?
There should we a direct way to bind Button click to Cancel, Start, Stop
@Vijay-Nirmal Not sure what you mean by "direct", but you can simply use a Command or use x:Bind to stop the Download.
Is it possible to add Parallel Downloading support like IDM to increase the overall download speed?
Whats the current status of this issue?
@Vijay-Nirmal Any update on this?
@Vijay-Nirmal is this being worked on your end or are we still planning to move with this any further?
I didn't work on this. If we need to proceed with this feature then I maybe (If I have time) able to work on this.
@michael-hawker is this something we want to proceed with?
I did something this years ago, you can use it as a head start.
See https://github.com/LanceMcCarthy/UwpProjects Scroll down to DownloadStreamwithProgressAsync https://github.com/LanceMcCarthy/UwpProjects#downloadstreamwithprogressasync-httpclient-extension
The original discussion seems to have been distracted by talk of uploading and recreating the store app UI for handling multiple concurrent downloads.
I suspect downloading individual files is something that is common enough that adding a helper to make this simpler would benefit a large number of developers. They could then add UI or multiple file functionality as necessary.
I'm not clear if this should be a purely code-based helper or come with UI.
For reference: https://docs.microsoft.com/en-us/samples/microsoft/windows-universal-samples/backgroundtransfer/
Thanks @mrlacey. I agree, a simple helper like @LanceMcCarthy provided to aid in downloads would be great. Hooking up UI or anything else can be left to the developer. Though I'm thinking combined with the new MVVM Toolkit too, we could probably have a pretty simple example to demonstrate this too. @Sergio0694 does the Task binding/helpers support progress somehow at all?
For more complex UI or helpers beyond that I think are beyond the scope of the original issue. They're probably best left as a separate issue for further discussion (though I'm not sure if the Toolkit would be the best place for that depending on the proposal).
Moving this to our discussions channel.
Downloading from the web is a very common thing to do in Apps but it doesn't have any dedicated control for it. So it would be nice to have one.
Feature request for this control:
Downloader.URI(URI)
should set the item to be DownloadDownloader.GetInfo.Name
,Downloader.GetInfo.Size
, ... to get the Info about the item to be DownloadedDownloader.Start
,Downloader.Pause
,Downloader.Stop
Downloader.GetPercentage
to get the download compleated percentage so that it can be used for creatingProgessBar
Downloader.GetSpeed
to get the download speed