Different Windows Phone (13)

Source: Internet
Author: User
Tags xmlns

Background Task (background Task) file transfer (upload and download)

Introduced

Unique Windows Phone 7.5 (SDK 7.1) after the task

Background File transfer (download)

Background File transfer (upload)

Example

1, demo How to implement the background file transfer (download)

Backgroundtransferdownload.xaml

<phone:phoneapplicationpage x:class= "Demo.BackgroundTask.BackgroundTransferDownload" xmlns= "http://schemas.m Icrosoft.com/winfx/2006/xaml/presentation "xmlns:x=" Http://schemas.microsoft.com/winfx/2006/xaml "xmlns:phone=" Clr-namespace:microsoft.phone.controls;assembly=microsoft.phone "Xmlns:shell=" Clr-namespace:
    Microsoft.phone.shell;assembly=microsoft.phone "xmlns:d=" http://schemas.microsoft.com/expression/blend/2008 " Xmlns:mc= "http://schemas.openxmlformats.org/markup-compatibility/2006" fontfamily= "{StaticResource Phonefontfamilynormal} "fontsize=" {StaticResource phonefontsizenormal} "foreground=" {StaticResource PhoneForegroun Dbrush} "supportedorientations=" Portrait "orientation=" Portrait "mc:ignorable=" D "d:designheight=" 768 "D:DesignWid 
        Th= "shell:systemtray.isvisible=" "True" > <grid x:name= "layoutroot" background= "Transparent" > <stackpanel orientation= "Vertical" > &Lt Button X:name= "Btndownloadsilverlightdemo" content= "Download Silverlight Demo compression package" click= "Btndownloadsilverlightdemo_click "/> <button x:name=" Btndownloadxnademo "content=" Download XNA Demo compression package "click= Btndownloadxnademo_click"/&G 
            T <button x:name= "Btndownloadwindowsphonedemo" content= download WindowsPhone Demo compression package "click=" 
            Btndownloadwindowsphonedemo_click "/> <textblock text=" Download Task List: "margin=" 0 0 0 "/> 
                        <listbox name= "ListBox" > <ListBox.ItemTemplate> <DataTemplate>  
                                <grid margin= "0" width= "> <Grid.ColumnDefinitions>" <columndefinition width= "8*"/> <columndefiniti 
                               
                            On width= "2*"/> </Grid.ColumnDefinitions> 
          <Grid>                      <stackpanel orientation= "Vertical" > <stackpanel Orient 
                                        ation= "Horizontal" > <textblock text= "filename:"/> 
                                    <textblock text= "{Binding Tag}"/> </StackPanel> <stackpanel orientation= "Horizontal" > <textbl 
                                    Ock text= "Download status:"/> <textblock text= "{Binding transferstatus}"/> </StackPanel> <stackpanel orientation= "Horizo 
                                        Ntal "> <textblock text=" bytes Received: "/> 
                                <textblock text= "{Binding bytesreceived}"/> </StackPanel>    <stackpanel orientation= "Horizontal" > <textblock text= "total bytes:"/> 
                                    <textblock text= "{Binding totalbytestoreceive}"/> </StackPanel> </StackPanel> &L T;/grid> <grid grid.column= "1" > <button x:name= " 
                            Btncancel "tag=" {Binding RequestID} "click= Btncancel_click" content= "Delete Task" ></Button> </Grid> </Grid> </DataTemplate> </li stbox.itemtemplate> </ListBox> </StackPanel> &LT;/GRID&G 

    
T </phone:PhoneApplicationPage>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.