<UserControl x:Class="SLApp.MainPage"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
             mc:Ignorable="d"
             d:DesignWidth="640"
             d:DesignHeight="480">
    <Border Padding="9">
        <Border.Background>
            <LinearGradientBrush EndPoint="0.5,1"
                                 StartPoint="0.5,0">
                <GradientStop Color="#FF686969" />
                <GradientStop Color="#FF95969b"
                              Offset="1" />
            </LinearGradientBrush>
        </Border.Background>
        <telerik:RadUpload x:Name="radUpload"
                           Filter="All Files(*.*)|*.*"
                           FilterIndex="1"
                           IsMultiselect="True"
                           IsAutomaticUpload="False"
                           OverwriteExistingFiles="True"
                           UploadServiceUrl="../MyUploadHandler.ashx"
                           TargetFolder="MyStorageFolder"
                           FileUploaded="radUpload_FileUploaded">
            <telerik:RadUpload.ItemContainerStyle>
                <Style TargetType="telerik:RadUploadItem">
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="telerik:RadUploadItem">
                                <Grid Margin="0,5">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*" />
                                        <ColumnDefinition Width="Auto" />
                                    </Grid.ColumnDefinitions>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto" />
                                        <RowDefinition Height="Auto" />
                                    </Grid.RowDefinitions>
                                    <TextBlock x:Name="NewFileName"
                                               Grid.Row="1"
                                               Grid.ColumnSpan="2"
                                               Text=""
                                               Visibility="Collapsed"
                                               HorizontalAlignment="Stretch"
                                               Margin="22,0,0,0"
                                               Foreground="Gray"
                                               FontStyle="Italic" />
                                    <telerik:RadProgressBar Height="25"
                                                            MinHeight="20"
                                                            x:Name="FileProgressBar"
                                                            Minimum="0"
                                                            Maximum="100"
                                                            Grid.ColumnSpan="2" />
                                    <TextBlock Text="{TemplateBinding FileName}"
                                               HorizontalAlignment="Left"
                                               VerticalAlignment="Center"
                                               Margin="10 0 0 0"
                                               TextWrapping="NoWrap"
                                               Grid.Column="0" />
                                    <StackPanel Orientation="Horizontal"
                                                HorizontalAlignment="Right"
                                                VerticalAlignment="Center"
                                                Grid.Column="1">
                                        <TextBlock Text="{TemplateBinding FileSize}"
                                                   Margin="8,0,10,0"
                                                   TextWrapping="NoWrap"
                                                   VerticalAlignment="Center" />
                                        <Grid VerticalAlignment="Center"
                                              Height="25">
                                            <Path VerticalAlignment="Center"
                                                  x:Name="IconDelete"
                                                  Margin="0,-4,5,0"
                                                  Cursor="Hand"
                                                  Stretch="Fill"
                                                  Fill="#FF000000"
                                                  Data="M5.0000001,0 L7,0 7,5 12,5 12,7 7,7 7,12 5.0000001,12 5.0000001,7 0,7 0,5 5.0000001,5 5.0000001,0 z"
                                                  Width="12"
                                                  Height="12">
                                                <Path.RenderTransform>
                                                    <TransformGroup>
                                                        <RotateTransform Angle="45" />
                                                    </TransformGroup>
                                                </Path.RenderTransform>
                                            </Path>
                                            <Path VerticalAlignment="Center"
                                                  x:Name="IconDone"
                                                  Margin="0,0,10,0"
                                                  Stretch="Fill"
                                                  Visibility="Collapsed"
                                                  Fill="#FF000000"
                                                  Data="M719.90131,266.74252 L728,276.64667 L743.13574,254.96999 L727.96881,271.52853"
                                                  Width="12"
                                                  Height="12" />
                                            <Grid VerticalAlignment="Center"
                                                  x:Name="IconError"
                                                  Margin="0,0,10,0"
                                                  Visibility="Collapsed"
                                                  Width="14.609"
                                                  Height="17.97">
                                                <Path Stretch="Fill"
                                                      Stroke="#FFFFFFFF"
                                                      Margin="0,1.786,0,3.288"
                                                      Data="M577.89149,269.68195 L584.80031,257.78582 591.50111,269.64775 z">
                                                    <Path.Fill>
                                                        <LinearGradientBrush EndPoint="0.5,0"
                                                                             StartPoint="0.5,1">
                                                            <GradientStop Color="#FFFFC600"
                                                                          Offset="0" />
                                                            <GradientStop Color="#FFFDFF00"
                                                                          Offset="1" />
                                                        </LinearGradientBrush>
                                                    </Path.Fill>
                                                </Path>
                                                <TextBlock Margin="6,4,6,4"
                                                           Width="Auto"
                                                           Height="Auto"
                                                           FontSize="8"
                                                           FontWeight="Bold"
                                                           Text="!"
                                                           TextWrapping="Wrap" />
                                            </Grid>
                                        </Grid>
                                    </StackPanel>
                                </Grid>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </telerik:RadUpload.ItemContainerStyle>
        </telerik:RadUpload>
    </Border>
</UserControl>
