<phone:PhoneApplicationPage 
    x:Class="BackgroundFileTransferSample.MainPage"
    xmlns="http://schemas.microsoft.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"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    shell:SystemTray.IsVisible="True">

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
            <TextBlock x:Name="ApplicationTitle" Text="WINDOWS PHONE 7.5" Style="{StaticResource PhoneTextNormalStyle}"/>
            <TextBlock x:Name="PageTitle" Text="BackgroundFileTransfer" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}" FontSize="40" />
        </StackPanel>

        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="1">
            <!-- ListBox mit den Transferanfragen -->
            <ListBox Name="TransferListBox" Margin="0,0,0,90">
                <ListBox.ItemTemplate>
                    <!-- Template fuer eine Transferanfrage -->
                    <DataTemplate>
                        <Grid Background="Transparent" Margin="0,0,0,30">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="380"/>
                                <ColumnDefinition Width="75"/>
                            </Grid.ColumnDefinitions>
                            <Grid Grid.Column="0">

                                <StackPanel Orientation="Vertical">
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock Text="{Binding Tag}"  Foreground="{StaticResource PhoneAccentBrush}" FontWeight="Bold" TextWrapping="Wrap" TextTrimming="WordEllipsis" />
                                    </StackPanel>
                                    
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock Text="Status: "/>
                                        <TextBlock Text="{Binding TransferStatus}" HorizontalAlignment="Right" />
                                    </StackPanel>

                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock Text="Bytes empfangen: "/>
                                        <TextBlock Text="{Binding BytesReceived}" HorizontalAlignment="Right"/>
                                    </StackPanel>
                                    
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock Text="gesamte Bytes: "/>
                                        <TextBlock Text="{Binding TotalBytesToReceive}" HorizontalAlignment="Right"/>
                                    </StackPanel>

                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock Text="Präferenz: "/>
                                        <TextBlock Text="{Binding TransferPreferences}" HorizontalAlignment="Right"/>
                                    </StackPanel>

                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock Text="ID: "/>
                                        <TextBlock Text="{Binding RequestId}" HorizontalAlignment="Right"/>
                                    </StackPanel>

                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock Text="URL: "/>
                                        <TextBlock Text="{Binding RequestUri}" HorizontalAlignment="Right" />
                                    </StackPanel>

                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock Text="Ziel: "/>
                                        <TextBlock Text="{Binding DownloadLocation}" HorizontalAlignment="Right" />
                                    </StackPanel>

                                </StackPanel>

                            </Grid>
                            <Grid Grid.Column="1">
                                <Button Name="btn_Cancel" Click="btn_Cancel_Click" Tag="{Binding RequestId}" VerticalContentAlignment="Center"  HorizontalContentAlignment="Center" Content="X" BorderBrush="Red" Background="Red" Foreground="White" FontWeight="Bold" VerticalAlignment="Top" BorderThickness="0" Width="75" Height="75" Padding="5,0,0,0"></Button>
                            </Grid>
                        </Grid>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
            <Button Content="Downloads wählen" Height="72" HorizontalAlignment="Left" Margin="0,577,0,0" Name="btn_ChooseDownloads" VerticalAlignment="Top" Width="480" Click="btn_ChooseDownloads_Click" />
        </Grid>
    </Grid>
 
  

</phone:PhoneApplicationPage>