<ResourceDictionary
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
        xmlns:c="http://schemas.telerik.com/2008/xaml/compile"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        mc:Ignorable="c"
        xmlns:telerikCloud="clr-namespace:Telerik.Windows.Cloud.Controls;assembly=Telerik.Windows.Cloud.Controls"
        xmlns:telerikCloudUpload="clr-namespace:Telerik.Windows.Cloud.Controls.Upload;assembly=Telerik.Windows.Cloud.Controls">
    <ResourceDictionary.MergedDictionaries>
        <telerik:Office2013ResourceDictionary/>
    </ResourceDictionary.MergedDictionaries>
    <SolidColorBrush x:Key="CloudUpload_Background" Color="White"/>
    <SolidColorBrush x:Key="CloudUpload_BorderBrush" Color="#FFABABAB"/>
    <SolidColorBrush x:Key="CloudUpload_Foreground" Color="#FF000000"/>
    <SolidColorBrush x:Key="CloudUploadButtonPath_NormalFill" Color="#FF767676"/>
    <SolidColorBrush x:Key="CloudUploadList_Background" Color="#FFFFFFFF"/>
    <SolidColorBrush x:Key="CloudUploadListItem_Foreground" Color="#FF767676"/>
    <SolidColorBrush x:Key="CloudUploadUploadedIcon_Fill" Color="#FF0072C6"/>
    <SolidColorBrush x:Key="CloudUploadNotificationIcon_OuterFill" Color="#FF000000"/>
    <LinearGradientBrush x:Key="CloudUploadNotificationIcon_InnerFill" EndPoint="0.5,0" StartPoint="0.5,1">
        <GradientStop Color="#FFFFC600" Offset="0"/>
        <GradientStop Color="#FFFDFF00" Offset="1"/>
    </LinearGradientBrush>
    <SolidColorBrush x:Key="CloudUploadButtonPath_MouseOverFill" Color="#FF000000"/>
    <SolidColorBrush x:Key="CloudUploadButtonPath_PressedFill" Color="#FF000000"/>
    <Thickness x:Key="CloudUploadButtons_Margin">0 0 10 5</Thickness>
    <telerikCloud:HumanReadableFileSizeConverter x:Key="CloudUpload_HumanReadableFileSizeConverter"/>
    <telerikCloud:StringToFileNameConverter x:Key="CloudUpload_StringToFileNameConverter"/>
    <telerik:FlagEnumToVisibilityConverter x:Key="CloudUpload_FlagEnumToVisibilityConverter"/>
    <PathGeometry x:Key="CloudUpload_CancelButtonIcon">M1.25,2.75 L1.24,2.77 C0.52,4.54 1.43,7 4,7 4.47,7 4.89,6.92 5.25,6.77 L5.26,6.76z M4,1 C3.53,1,3.12,1.1,2.76,1.23 L2.74,1.24 6.76,5.26 6.77,5.23 C7.48,3.46,6.55,1,4,1z M4,0 C9.3,0 9.36,8 4,8 -1.36,8 -1.3,0 4,0z</PathGeometry>
    <Style TargetType="Path" x:Key="CloudUploadPathStyle">
        <Setter Property="Fill" Value="{StaticResource CloudUploadButtonPath_NormalFill}"/>
        <Setter Property="HorizontalAlignment" Value="Center"/>
        <Setter Property="VerticalAlignment" Value="Center"/>
        <Style.Triggers>
            <DataTrigger Binding="{Binding Path=IsMouseOver, RelativeSource={RelativeSource AncestorType={x:Type telerik:RadButton}}}" Value="True">
                <Setter Property="Fill" Value="{StaticResource CloudUploadButtonPath_MouseOverFill}"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding Path=IsPressed, RelativeSource={RelativeSource AncestorType={x:Type telerik:RadButton}}}" Value="True">
                <Setter Property="Fill" Value="{StaticResource CloudUploadButtonPath_PressedFill}"/>
            </DataTrigger>
        </Style.Triggers>
    </Style>
    <Style x:Key="RadCloudUploadListItemStyle" TargetType="{x:Type telerikCloud:RadCloudUploadListItem}">
        <Setter Property="Padding" Value="10"/>
        <Setter Property="Foreground" Value="{StaticResource CloudUploadListItem_Foreground}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type telerikCloud:RadCloudUploadListItem}">
                    <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                        <Grid Margin="{TemplateBinding Padding}">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <Grid x:Name="FileInformation" HorizontalAlignment="Left">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <TextBlock TextTrimming="CharacterEllipsis" Text="{Binding FileName, Mode=OneWay, Converter={StaticResource CloudUpload_StringToFileNameConverter}}" Margin="0 0 5 0"/>
                                <TextBlock Grid.Column="1" Text="{Binding FileSize, Mode=OneWay, StringFormat=({0}), Converter={StaticResource CloudUpload_HumanReadableFileSizeConverter}, ConverterParameter=0.##}"/>
                            </Grid>
                            <telerik:RadProgressBar x:Name="ProgressBar" Grid.Row="1" Maximum="{Binding FileSize, Mode=OneWay}" Value="{Binding UploadedBytes, Mode=OneWay}" Margin="0 0 1 0" MinHeight="6" Height="6"/>
                            <Grid Grid.Row="1" Grid.Column="1">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <Grid Grid.Column="0" Margin="5 0 0 0">
                                    <Border x:Name="CancelButtonWrapper" Visibility="Hidden" MinWidth="18" MinHeight="18">
                                        <telerik:RadButton
                                                Command="{Binding RequestCancelCommand}"
                                                Visibility="{TemplateBinding Buttons, Converter={StaticResource CloudUpload_FlagEnumToVisibilityConverter}, ConverterParameter=Cancel}"
                                                ToolTip="{telerik:LocalizableResource Key=CloudUploadItem_Cancel}"
                                                IsBackgroundVisible="False"
                                                BorderBrush="Transparent">
                                            <Path Data="{StaticResource CloudUpload_CancelButtonIcon}" Style="{StaticResource CloudUploadPathStyle}" Stretch="Fill"/>
                                        </telerik:RadButton>
                                    </Border>
                                    <Border x:Name="UploadedIcon" Visibility="Hidden" Background="Transparent" ToolTip="{telerik:LocalizableResource Key=CloudUploadItem_Uploaded}">
                                        <Path
                                                Data="M0,3 L3,6 L7,0"
                                                Stroke="{StaticResource CloudUploadUploadedIcon_Fill}"
                                                HorizontalAlignment="Center"
                                                VerticalAlignment="Center"
                                                Stretch="Fill"
                                                StrokeThickness="1.5"/>
                                    </Border>
                                    <Grid x:Name="NotificationIcon" Visibility="Hidden" ToolTip="{Binding State}" Width="14" Height="14">
                                        <Path Data="M0,14 L7,0 L14,14z" Stretch="Fill" Fill="{StaticResource CloudUploadNotificationIcon_OuterFill}"/>
                                        <Path Data="M0,14 L7,0 L14,14z M6,5L8,5L8,9L6,9z M6,10L8,10L8,12L6,12" Stretch="Fill" Fill="{StaticResource CloudUploadNotificationIcon_InnerFill}"/>
                                    </Grid>
                                </Grid>
                                <Border x:Name="UploadButtonWrapper" Visibility="Hidden" ToolTip="{telerik:LocalizableResource Key=CloudUploadItem_Upload}">
                                    <telerik:RadButton
                                            Margin="5 0 0 0"
                                            Command="{Binding StartUploadCommand}"
                                            MinHeight="18"
                                            Width="18"
                                            Visibility="{TemplateBinding Buttons, Converter={StaticResource CloudUpload_FlagEnumToVisibilityConverter}, ConverterParameter=Upload}"
                                            IsBackgroundVisible="False"
                                            BorderBrush="Transparent"
                                            MinWidth="18">
                                        <Path Data="M4,0 L0,4 L2,4 L2,8 L6,8 L6,4 L8,4 z" Style="{StaticResource CloudUploadPathStyle}"/>
                                    </telerik:RadButton>
                                </Border>
                                <telerik:RadButton
                                        Grid.Column="2"
                                        MinHeight="18"
                                        Width="18"
                                        Padding="0"
                                        Command="{Binding RequestCloseCommand}"
                                        Visibility="{TemplateBinding Buttons, Converter={StaticResource CloudUpload_FlagEnumToVisibilityConverter}, ConverterParameter=Close}"
                                        ToolTip="{telerik:LocalizableResource Key=CloudUploadItem_Close}"
                                        IsBackgroundVisible="False"
                                        BorderBrush="Transparent"
                                        MinWidth="18"
                                        Margin="5 0 0 0">
                                    <Path Data="M1,0 L4,3 L7,0 L8,1 L5,4 L8,7 L7,8 L4,5 L1,8 L0,7 L3,4 L0,1 z" Style="{StaticResource CloudUploadPathStyle}"/>
                                </telerik:RadButton>
                            </Grid>
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <DataTrigger Binding="{Binding State}" Value="NotStarted">
                            <Setter TargetName="UploadButtonWrapper" Property="Visibility" Value="Visible"/>
                        </DataTrigger>
                        <DataTrigger Binding="{Binding State}" Value="Uploading">
                            <Setter TargetName="CancelButtonWrapper" Property="Visibility" Value="Visible"/>
                        </DataTrigger>
                        <DataTrigger Binding="{Binding State}" Value="Queued">
                            <Setter TargetName="CancelButtonWrapper" Property="Visibility" Value="Visible"/>
                        </DataTrigger>
                        <DataTrigger Binding="{Binding State}" Value="Uploaded">
                            <Setter TargetName="UploadedIcon" Property="Visibility" Value="Visible"/>
                        </DataTrigger>
                        <DataTrigger Binding="{Binding State}" Value="Cancelling">
                            <Setter TargetName="CancelButtonWrapper" Property="Visibility" Value="Visible"/>
                        </DataTrigger>
                        <DataTrigger Binding="{Binding State}" Value="Canceled">
                            <Setter TargetName="NotificationIcon" Property="Visibility" Value="Visible"/>
                            <Setter TargetName="NotificationIcon" Property="ToolTip" Value="{telerik:LocalizableResource Key=CloudUploadItem_Canceled}"/>
                        </DataTrigger>
                        <DataTrigger Binding="{Binding State}" Value="Failed">
                            <Setter TargetName="NotificationIcon" Property="Visibility" Value="Visible"/>
                            <Setter TargetName="NotificationIcon" Property="ToolTip" Value="{telerik:LocalizableResource Key=CloudUploadItem_Failed}"/>
                            <Setter TargetName="UploadButtonWrapper" Property="Grid.Column" Value="1"/>
                            <Setter TargetName="UploadButtonWrapper" Property="Visibility" Value="Visible"/>
                        </DataTrigger>
                        <DataTrigger Binding="{Binding State}" Value="Invalid">
                            <Setter TargetName="FileInformation" Property="Grid.Row" Value="1"/>
                            <Setter TargetName="ProgressBar" Property="Visibility" Value="Hidden"/>
                            <Setter TargetName="NotificationIcon" Property="Visibility" Value="Visible"/>
                            <Setter TargetName="NotificationIcon" Property="ToolTip">
                                <Setter.Value>
                                    <ItemsControl ItemsSource="{Binding ValidationErrors}"/>
                                </Setter.Value>
                            </Setter>
                        </DataTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="RadCloudUploadListStyle" TargetType="{x:Type telerikCloud:RadCloudUploadList}" BasedOn="{StaticResource {x:Type ItemsControl}}">
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="BorderBrush" Value="{StaticResource CloudUpload_BorderBrush}"/>
        <Setter Property="Background" Value="{StaticResource CloudUploadList_Background}"/>
    </Style>
    <Style x:Key="RadCloudUploadStyle" TargetType="{x:Type telerikCloud:RadCloudUpload}">
        <Setter Property="Padding" Value="10"/>
        <Setter Property="Background" Value="{StaticResource CloudUpload_Background}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="BorderBrush" Value="{StaticResource CloudUpload_BorderBrush}"/>
        <Setter Property="Foreground" Value="{StaticResource CloudUpload_Foreground}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type telerikCloud:RadCloudUpload}">
                    <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                        <Grid Margin="{TemplateBinding Padding}">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition/>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <WrapPanel>
                                <telerik:RadButton
                                        Content="{telerik:LocalizableResource Key=CloudUpload_Browse}"
                                        Command="{x:Static telerikCloudUpload:CloudUploadCommands.Browse}"
                                        Visibility="{TemplateBinding Buttons, Converter={StaticResource CloudUpload_FlagEnumToVisibilityConverter}, ConverterParameter=Browse}"
                                        Margin="{StaticResource CloudUploadButtons_Margin}"/>
                                <telerik:RadButton
                                        Content="{telerik:LocalizableResource Key=CloudUpload_AddFiles}"
                                        Command="{x:Static telerikCloudUpload:CloudUploadCommands.AddFiles}"
                                        Visibility="{TemplateBinding Buttons, Converter={StaticResource CloudUpload_FlagEnumToVisibilityConverter}, ConverterParameter=AddFiles}"
                                        Margin="{StaticResource CloudUploadButtons_Margin}"/>
                                <telerik:RadButton
                                        Content="{telerik:LocalizableResource Key=CloudUpload_Upload}"
                                        Command="{x:Static telerikCloudUpload:CloudUploadCommands.StartUpload}"
                                        Visibility="{TemplateBinding Buttons, Converter={StaticResource CloudUpload_FlagEnumToVisibilityConverter}, ConverterParameter=Upload}"
                                        Margin="{StaticResource CloudUploadButtons_Margin}"/>
                                <telerik:RadButton
                                        Content="{telerik:LocalizableResource Key=CloudUpload_Cancel}"
                                        Command="{x:Static telerikCloudUpload:CloudUploadCommands.RequestCancel}"
                                        Visibility="{TemplateBinding Buttons, Converter={StaticResource CloudUpload_FlagEnumToVisibilityConverter}, ConverterParameter=Cancel}"
                                        Margin="{StaticResource CloudUploadButtons_Margin}"/>
                                <telerik:RadButton
                                        Content="{telerik:LocalizableResource Key=CloudUpload_ClearUploaded}"
                                        Command="{x:Static telerikCloudUpload:CloudUploadCommands.ClearUploadedItems}"
                                        Visibility="{TemplateBinding Buttons, Converter={StaticResource CloudUpload_FlagEnumToVisibilityConverter}, ConverterParameter=ClearUploaded}"
                                        Margin="{StaticResource CloudUploadButtons_Margin}"/>
                            </WrapPanel>
                            <TextBlock
                                    Grid.Column="1"
                                    Text="{TemplateBinding TotalSize, Converter={StaticResource CloudUpload_HumanReadableFileSizeConverter}, ConverterParameter=0.##}"
                                    FontWeight="Bold"
                                    Margin="0 0 5 0"
                                    VerticalAlignment="Center"/>
                            <Grid Grid.Column="2" VerticalAlignment="Center">
                                <Border x:Name="UploadedIcon" Background="Transparent" Visibility="Collapsed">
                                    <Path
                                            Data="M0,3 L3,6 L7,0"
                                            Stroke="{StaticResource CloudUploadUploadedIcon_Fill}"
                                            HorizontalAlignment="Center"
                                            VerticalAlignment="Center"
                                            Stretch="Fill"
                                            StrokeThickness="1.5"/>
                                    <Border.ToolTip>
                                        <StackPanel>
                                            <TextBlock>
                                                <Run Text="{Binding ItemsSummary.UploadedItemsCount, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}"/>
                                                <Run Text="uploaded files"/>
                                            </TextBlock>
                                        </StackPanel>
                                    </Border.ToolTip>
                                </Border>
                                <Grid x:Name="NotificationIcon" Width="14" Height="14">
                                    <Path Data="M0,14 L7,0 L14,14z" Stretch="Fill" Fill="{StaticResource CloudUploadNotificationIcon_OuterFill}"/>
                                    <Path Data="M0,14 L7,0 L14,14z M6,5L8,5L8,9L6,9z M6,10L8,10L8,12L6,12" Stretch="Fill" Fill="{StaticResource CloudUploadNotificationIcon_InnerFill}"/>
                                    <Grid.ToolTip>
                                        <StackPanel>
                                            <TextBlock x:Name="InvalidItemsTextBlock">
                                                <Run Text="{Binding ItemsSummary.InvalidItemsCount, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}"/>
                                                <Run Text="{telerik:LocalizableResource Key=CloudUpload_InvalidFiles}"/>
                                            </TextBlock>
                                            <TextBlock x:Name="FailedItemsTextBlock">
                                                <Run Text="{Binding ItemsSummary.FailedItemsCount, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}"/>
                                                <Run Text="{telerik:LocalizableResource Key=CloudUpload_FailedFiles}"/>
                                            </TextBlock>
                                        </StackPanel>
                                    </Grid.ToolTip>
                                </Grid>
                            </Grid>
                            <telerik:RadProgressBar Grid.Row="1" Grid.ColumnSpan="2" VerticalAlignment="Center" Maximum="1" Value="{TemplateBinding Progress}" Margin="0 0 5 0" MinHeight="6" Height="6"/>
                            <telerik:RadButton
                                    Grid.Row="1"
                                    Grid.Column="2"
                                    MinHeight="18"
                                    Width="18"
                                    Command="{x:Static telerikCloudUpload:CloudUploadCommands.ClearItems}"
                                    Visibility="{TemplateBinding Buttons, Converter={StaticResource CloudUpload_FlagEnumToVisibilityConverter}, ConverterParameter=Clear}"
                                    ToolTip="{telerik:LocalizableResource Key=CloudUpload_ClearItems}"
                                    IsBackgroundVisible="False"
                                    BorderBrush="Transparent"
                                    MinWidth="18">
                                <Path Data="M1,0 L4,3 L7,0 L8,1 L5,4 L8,7 L7,8 L4,5 L1,8 L0,7 L3,4 L0,1 z" Style="{StaticResource CloudUploadPathStyle}"/>
                            </telerik:RadButton>
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Binding="{Binding ItemsSummary.NotStartedItemsCount, RelativeSource={RelativeSource Self}}" Value="0"/>
                                <Condition Binding="{Binding ItemsSummary.UploadingItemsCount, RelativeSource={RelativeSource Self}}" Value="0"/>
                                <Condition Binding="{Binding ItemsSummary.CancellingItemsCount, RelativeSource={RelativeSource Self}}" Value="0"/>
                                <Condition Binding="{Binding ItemsSummary.FailedItemsCount, RelativeSource={RelativeSource Self}}" Value="0"/>
                                <Condition Binding="{Binding ItemsSummary.InvalidItemsCount, RelativeSource={RelativeSource Self}}" Value="0"/>
                            </MultiDataTrigger.Conditions>
                            <Setter TargetName="UploadedIcon" Property="Visibility" Value="Visible"/>
                        </MultiDataTrigger>
                        <DataTrigger Binding="{Binding ItemsSummary.UploadedItemsCount, RelativeSource={RelativeSource Self}}" Value="0">
                            <Setter TargetName="UploadedIcon" Property="Visibility" Value="Collapsed"/>
                        </DataTrigger>
                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Binding="{Binding ItemsSummary.InvalidItemsCount, RelativeSource={RelativeSource Self}}" Value="0"/>
                                <Condition Binding="{Binding ItemsSummary.FailedItemsCount, RelativeSource={RelativeSource Self}}" Value="0"/>
                            </MultiDataTrigger.Conditions>
                            <Setter TargetName="NotificationIcon" Property="Visibility" Value="Hidden"/>
                        </MultiDataTrigger>
                        <DataTrigger Binding="{Binding ItemsSummary.InvalidItemsCount, RelativeSource={RelativeSource Self}}" Value="0">
                            <Setter TargetName="InvalidItemsTextBlock" Property="Visibility" Value="Collapsed"/>
                        </DataTrigger>
                        <DataTrigger Binding="{Binding ItemsSummary.FailedItemsCount, RelativeSource={RelativeSource Self}}" Value="0">
                            <Setter TargetName="FailedItemsTextBlock" Property="Visibility" Value="Collapsed"/>
                        </DataTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="telerikCloud:RadCloudUploadListItem" BasedOn="{StaticResource RadCloudUploadListItemStyle}"/>
    <Style TargetType="telerikCloud:RadCloudUploadList" BasedOn="{StaticResource RadCloudUploadListStyle}"/>
    <Style TargetType="telerikCloud:RadCloudUpload" BasedOn="{StaticResource RadCloudUploadStyle}"/>
</ResourceDictionary>
