<Window x:Class="XDM.Wpf.UI.MainWindow"
        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:local="clr-namespace:XDM.Wpf.UI"
        DataContext="{Binding RelativeSource={RelativeSource Self}}"
        mc:Ignorable="d"
        Title="Xtreme Download Manager" Height="500" Width="800" WindowStartupLocation="CenterScreen" Closing="Window_Closing">
    <Window.Resources>
        <Style TargetType="Button" >
            <Setter Property="SnapsToDevicePixels" Value="true"/>
            <Setter Property="OverridesDefaultStyle" Value="true"/>
            <Setter Property="FocusVisualStyle"  Value="{x:Null}"/>
            <Setter Property="MinHeight" Value="23"/>
            <Setter Property="MinWidth" Value="5"/>
            <Setter Property="Background" Value="{StaticResource ButtonBackcolor}"/>
            <Setter Property="BorderBrush" Value="{StaticResource ButtonBorder}"/>
            <Setter Property="Padding" Value="10,3"/>
            <Setter Property="Margin" Value="3,3"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Border 
                              x:Name="Border"  
                              BorderThickness="{TemplateBinding BorderThickness}"
                              Padding="{TemplateBinding Padding}"
                              Margin="{TemplateBinding Margin}"
                              Background="{TemplateBinding Background}"
                              BorderBrush="{TemplateBinding BorderBrush}">
                            <ContentPresenter SnapsToDevicePixels="True"  Margin="2" HorizontalAlignment="Center" VerticalAlignment="Center" RecognizesAccessKey="True"/>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsKeyboardFocused" Value="true">
                                <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource ButtonFocusedBorder}" />
                            </Trigger>
                            <Trigger Property="IsDefaulted" Value="true">
                                <Setter TargetName="Border" Property="Background" Value="{StaticResource ButtonBackcolor}" />
                            </Trigger>
                            <Trigger Property="IsMouseOver" Value="true">
                                <Setter TargetName="Border" Property="Background" Value="{StaticResource ButtonMouseOverBackcolor}" />
                            </Trigger>
                            <Trigger Property="IsPressed" Value="true">
                                <Setter TargetName="Border" Property="Background" Value="{StaticResource ButtonMousePressedBackcolor}" />
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter Property="Opacity" Value="{StaticResource ButtonDisabledOpacity}"/>
                            </Trigger>
                            <Trigger Property="IsFocused" Value="True">
                                <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource ButtonFocusedBorder}"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <ContextMenu x:Key="ctxMainMenu" x:Name="ctxMainMenu" 
                     LayoutUpdated="ctxMainMenu_LayoutUpdated">
            <MenuItem Name="menuSettings" Header="{StaticResource TITLE_SETTINGS}" 
                      Foreground="{StaticResource ControlForecolor}" Click="menuSettings_Click"/>
            <MenuItem Name="menuBrowserMonitor" Header="{StaticResource SETTINGS_MONITORING}" Click="menuBrowserMonitor_Click"
                      Foreground="{StaticResource ControlForecolor}"/>
            <MenuItem Name="menuMediaGrabber" Header="{StaticResource MSG_MEDIA_CAPTURE}" Click="menuMediaGrabber_Click"
                      Foreground="{StaticResource ControlForecolor}"/>
            <MenuItem Name="menuClearFinished" Header="{StaticResource MENU_DELETE_COMPLETED}" Click="menuClearFinished_Click" 
                      Foreground="{StaticResource ControlForecolor}"/>
            <MenuItem Name="menuExport" Header="{StaticResource MENU_EXPORT}" Click="menuExport_Click"
                      Foreground="{StaticResource ControlForecolor}"/>
            <MenuItem Name="menuImport" Header="{StaticResource MENU_IMPORT}" Click="menuImport_Click"
                      Foreground="{StaticResource ControlForecolor}"/>
            <MenuItem Name="menuLanguage" Header="{StaticResource MENU_LANG}" 
                      Foreground="{StaticResource ControlForecolor}" Click="menuLanguage_Click"/>
            <!--<MenuItem Name="extRegister" Header="{StaticResource MSG_REGISTER_EXT}" Click="extRegister_Click"
                      Foreground="{StaticResource ControlForecolor}"/>-->
            <MenuItem Name="menuHelpAndSupport" Header="{StaticResource LBL_SUPPORT_PAGE}" Click="menuHelpAndSupport_Click"
                      Foreground="{StaticResource ControlForecolor}"/>
            <MenuItem Name="menuReportProblem" Header="{StaticResource LBL_REPORT_PROBLEM}" Click="menuReportProblem_Click"
                      Foreground="{StaticResource ControlForecolor}"/>
            <MenuItem Name="menuCheckForUpdate" Header="{StaticResource MENU_UPDATE}" Click="menuCheckForUpdate_Click"
                      Foreground="{StaticResource ControlForecolor}"/>
            <MenuItem Name="menuAbout" Header="{StaticResource MENU_ABOUT}" Click="menuAbout_Click"
                      Foreground="{StaticResource ControlForecolor}"/>
            <MenuItem Name="menuExit" Header="{StaticResource MENU_EXIT}" 
                      Foreground="{StaticResource ControlForecolor}" Click="menuExit_Click"/>
        </ContextMenu>
        <ContextMenu x:Key="lvInProgressContextMenu"></ContextMenu>
        <ContextMenu x:Key="lvFinishedContextMenu"></ContextMenu>
        <ControlTemplate x:Key="ToolbarButtonTemplate" TargetType="{x:Type Button}">
            <Border Name="Border" BorderBrush="{StaticResource ToolButtonForecolor}" IsHitTestVisible="True" >
                <StackPanel Orientation="Horizontal" Margin="{TemplateBinding Padding}" IsHitTestVisible="True">
                    <Path 
                                VerticalAlignment="Center" 
                                Margin="0,0,10,0"
                                StrokeThickness="0" 
                                Stretch="Uniform" 
                                Fill="{Binding RelativeSource={RelativeSource Mode=FindAncestor, 
                        AncestorType=Border},Path=BorderBrush}"
                                Width="14" Height="14"  
                                Stroke="{Binding RelativeSource={RelativeSource Mode=FindAncestor, 
                        AncestorType=Border},Path=BorderBrush}" 
                                Data="{TemplateBinding Tag}"
                                SnapsToDevicePixels="True"/>
                    <ContentPresenter 
                        VerticalAlignment="Center" 
                        x:Name="ContentSite" 
                        Margin="0,0,0,0" 
                        TextBlock.Foreground="{StaticResource ToolButtonForecolor}"
                        TextBlock.FontSize="14">
                    </ContentPresenter>
                </StackPanel>
            </Border>
            <ControlTemplate.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter TargetName="Border" Property="Background" Value="{StaticResource ToolButtonMouseOverBackcolor}" />
                </Trigger>
                <Trigger Property="IsPressed" Value="True">
                    <Setter TargetName="Border" Property="Background" Value="{StaticResource ToolButtonMousePressedBackcolor}" />
                </Trigger>
                <Trigger Property="IsEnabled" Value="False">
                    <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource ToolButtonMouseDisabledForecolor}" />
                    <Setter TargetName="ContentSite" Property="TextBlock.Foreground" Value="{StaticResource ToolButtonMouseDisabledForecolor}" />
                </Trigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>
        <ControlTemplate x:Key="ToolbarButtonTemplateIconOnly" TargetType="{x:Type Button}">
            <Border Name="Border" BorderBrush="{StaticResource ToolButtonForecolor}" Background="Transparent" >
                <StackPanel Orientation="Horizontal" Margin="{TemplateBinding Padding}" Background="Transparent">
                    <Path VerticalAlignment="Center" 
                          Margin="0,0,0,0"
                          StrokeThickness="0" 
                          Stretch="Fill" 
                          Fill="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Border},Path=BorderBrush}"
                          Width="14" Height="14"  
                          Stroke="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Border},Path=BorderBrush}" 
                          Data="{TemplateBinding Tag}"
                          SnapsToDevicePixels="True"/>
                </StackPanel>
            </Border>
            <ControlTemplate.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter TargetName="Border" Property="Background" Value="{StaticResource ToolButtonMouseOverBackcolor}" />
                </Trigger>
                <Trigger Property="IsPressed" Value="True">
                    <Setter TargetName="Border" Property="Background" Value="{StaticResource ToolButtonMousePressedBackcolor}" />
                </Trigger>
                <Trigger Property="IsEnabled" Value="False">
                    <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource ToolButtonMouseDisabledForecolor}" />
                </Trigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>
        <ControlTemplate x:Key="ToolbarButtonTemplateIconOnlySmall" TargetType="{x:Type Button}" >
            <Border Name="Border" 
                    BorderBrush="{StaticResource ToolButtonForecolor}" 
                    Background="{StaticResource SearchBackcolor}" 
                    BorderThickness="0" 
                    >
                <StackPanel Orientation="Horizontal" Margin="{TemplateBinding Padding}" Background="Transparent">
                    <Path 
                                VerticalAlignment="Center" 
                                Margin="0,0,0,0"
                                StrokeThickness="0" 
                                Stretch="Uniform" 
                                Fill="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Border},Path=BorderBrush}"
                                Width="14" Height="14"  
                                Stroke="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Border},Path=BorderBrush}" 
                                Data="{TemplateBinding Tag}"
                                SnapsToDevicePixels="True"/>
                </StackPanel>
            </Border>
            <ControlTemplate.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter TargetName="Border" Property="Background" Value="{StaticResource ToolButtonMouseOverBackcolor}" />
                </Trigger>
                <Trigger Property="IsPressed" Value="True">
                    <Setter TargetName="Border" Property="Background" Value="{StaticResource ToolButtonMousePressedBackcolor}" />
                </Trigger>
                <Trigger Property="IsEnabled" Value="False">
                    <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource ToolButtonMouseDisabledForecolor}" />
                </Trigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>
        <ControlTemplate x:Key="MonitoringToggleButton" TargetType="{x:Type Button}">
            <Border Name="Border" BorderBrush="{TemplateBinding Foreground}" Background="{TemplateBinding Background}" >
                <ContentPresenter 
                        VerticalAlignment="Center" 
                        x:Name="ContentSite" 
                        Margin="0,0,0,0" 
                        TextBlock.Foreground="{TemplateBinding Foreground}"
                        TextBlock.FontSize="14">
                </ContentPresenter>
            </Border>
            <ControlTemplate.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter TargetName="Border" Property="Background" Value="{StaticResource ToolButtonMouseOverBackcolor}" />
                </Trigger>
                <Trigger Property="IsPressed" Value="True">
                    <Setter TargetName="Border" Property="Background" Value="{StaticResource ToolButtonMousePressedBackcolor}" />
                </Trigger>
                <Trigger Property="IsEnabled" Value="False">
                    <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource ToolButtonMouseDisabledForecolor}" />
                </Trigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>
        <ContextMenu x:Key="newDownloadContextMenu">
            <MenuItem Name="menuNewDownload" Foreground="{StaticResource ControlForecolor}"/>
            <MenuItem Name="menuVideoDownload" Foreground="{StaticResource ControlForecolor}"/>
            <MenuItem Name="menuBatchDownload" Foreground="{StaticResource ControlForecolor}"/>
        </ContextMenu>
    </Window.Resources>
    <Border BorderBrush="{StaticResource ToolbarBordercolor}" 
            BorderThickness="{StaticResource MainContentBorderThickness}" SnapsToDevicePixels="True">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="190"></ColumnDefinition>
                <ColumnDefinition Width="*"></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <ListBox BorderThickness="{StaticResource CategoryListBorderThickness}" 
                 Name="lvCategory" 
                 SelectionChanged="lvCategory_SelectionChanged" 
                 BorderBrush="{StaticResource ToolbarBordercolor}"
                 Background="{StaticResource CategoryListBackground}" >
                <ListBox.Resources>
                    <Style TargetType="{x:Type ListBoxItem}">
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="{x:Type ListBoxItem}">
                                    <Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}"
                                    BorderThickness="0"
                                    Background="{TemplateBinding Background}"
                                    Padding="{TemplateBinding Padding}"
                                    Tag="{StaticResource CategoryForegroundNormal}"
                                    SnapsToDevicePixels="true">
                                        <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                            SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                                    </Border>
                                    <ControlTemplate.Triggers>
                                        <Trigger Property="IsSelected" Value="True">
                                            <Setter Property="Background" TargetName="Bd" Value="{StaticResource CategoryHighlight}" />
                                            <Setter Property="Tag" TargetName="Bd" Value="{StaticResource CategoryForegroundSelected}" />
                                        </Trigger>
                                        <Trigger Property="IsMouseOver" Value="True">
                                            <Setter Property="Background" TargetName="Bd" Value="{StaticResource CategoryMouseOverBackground}" />
                                            <Setter Property="Tag" TargetName="Bd" Value="{StaticResource CategoryForegroundSelected}" />
                                        </Trigger>
                                        <!--<MultiTrigger>
                                            <MultiTrigger.Conditions>
                                                <Condition Property="Selector.IsSelectionActive" Value="False" />
                                                <Condition Property="IsSelected" Value="True" />
                                            </MultiTrigger.Conditions>
                                            <Setter Property="Background" TargetName="Bd" Value="{StaticResource CategoryHighlight}" />
                                            <Setter Property="Tag" TargetName="Bd" Value="{StaticResource CategoryForegroundSelected}" />
                                        </MultiTrigger>
                                        <MultiTrigger>
                                            <MultiTrigger.Conditions>
                                                <Condition Property="Selector.IsSelectionActive"
                                            Value="True" />
                                                <Condition Property="IsSelected"
                                            Value="True" />
                                            </MultiTrigger.Conditions>
                                            <Setter Property="Background" TargetName="Bd" Value="{StaticResource CategoryHighlight}" />
                                            <Setter Property="Tag" TargetName="Bd" Value="{StaticResource CategoryForegroundSelected}" />
                                        </MultiTrigger>-->
                                    </ControlTemplate.Triggers>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                    </Style>
                </ListBox.Resources>
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <StackPanel x:Name="CategoryItem" IsHitTestVisible="True" Margin="0,0">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*" />
                                    <ColumnDefinition Width="*" />
                                </Grid.ColumnDefinitions>
                                <Path 
                                Grid.Column="0" 
                                VerticalAlignment="Center" 
                                Margin="5,0" 
                                StrokeThickness="0" 
                                Stretch="None" 
                                Fill="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Border},Path=Tag}"
                                Width="24" Height="24"  Stroke="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Border},Path=Tag}"
                                Data="{Binding Path=VectorIcon, 
                                Converter={StaticResource CategoryToVectorImageConverter}}"
                                SnapsToDevicePixels="True"/>
                                <TextBlock Margin="5,0" Grid.Column="1" Text="{Binding Name}" 
                                       VerticalAlignment="Center" 
                                       Foreground="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Border},Path=Tag}" />
                            </Grid>
                        </StackPanel>
                        <DataTemplate.Triggers>
                            <DataTrigger Binding="{Binding Path=IsTopLevel}" Value="True">
                                <Setter TargetName="CategoryItem" Property="Margin" Value="10,5,10,5" />
                            </DataTrigger>
                            <DataTrigger Binding="{Binding Path=IsTopLevel}" Value="False">
                                <Setter TargetName="CategoryItem" Property="Margin" Value="25,5,10,5" />
                            </DataTrigger>
                        </DataTemplate.Triggers>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
            <DockPanel Grid.Column="1">
                <Border  DockPanel.Dock="Top" 
                     Background="{StaticResource ControlBackcolor}" 
                     BorderThickness="0,0,0,1" 
                     BorderBrush="{StaticResource ToolbarBordercolor}">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="auto"/>
                            <ColumnDefinition Width="auto"/>
                        </Grid.ColumnDefinitions>
                        <StackPanel Grid.Column="0" Orientation="Horizontal" >
                            <Button 
                                Background="{StaticResource ControlBackcolor}"
                                Foreground="{StaticResource ToolButtonForecolor}"
                                BorderThickness="0"
                                Margin="0"
                                Padding="15,12" 
                                Name="BtnNew">
                                <StackPanel Orientation="Horizontal">
                                    <Path 
                                        VerticalAlignment="Center"  Margin="0,0,10,0" Width="14" Height="14" Stretch="Uniform" StrokeThickness="0" 
                                        Fill="{StaticResource ToolButtonForecolor}" Stroke="{StaticResource ToolButtonForecolor}" 
                                        Data="{StaticResource ri-links-line}" SnapsToDevicePixels="True"/>
                                    <TextBlock Foreground="{StaticResource ToolButtonForecolor}" Text="{StaticResource DESC_NEW}"/>
                                </StackPanel>
                            </Button>

                            <Button 
                                Background="{StaticResource ControlBackcolor}"
                                Foreground="{StaticResource ToolButtonForecolor}"
                                BorderThickness="0"
                                Margin="0"
                                Padding="10,12" 
                                Name="BtnDelete">
                                <StackPanel Orientation="Horizontal">
                                    <Path 
                                        VerticalAlignment="Center"  Margin="0,0,10,0" Width="14" Height="14" Stretch="Uniform" StrokeThickness="0"
                                        Fill="{StaticResource ToolButtonForecolor}" Stroke="{StaticResource ToolButtonForecolor}"  SnapsToDevicePixels="True"
                                        Data="{StaticResource ri-delete-bin-line}"/>
                                    <TextBlock Foreground="{StaticResource ToolButtonForecolor}" Text="{StaticResource DESC_DEL}"/>
                                </StackPanel>
                            </Button>
                            <!--<Button Template="{StaticResource ToolbarButtonTemplate}" 
                            Padding="12,12" 
                            IsEnabled="False" 
                            Tag="{StaticResource ri-delete-bin-line}"
                            Name="BtnDelete">
                                Delete
                            </Button>-->
                            <!--<Button Template="{StaticResource ToolbarButtonTemplate}" 
                            Padding="12,12"   
                            IsEnabled="False" 
                            Tag="{StaticResource ri-mail-open-line}"
                            Name="BtnOpen">
                                Open
                            </Button>
                            <Button Template="{StaticResource ToolbarButtonTemplate}" 
                            Padding="12,10"  
                            IsEnabled="False" 
                            Tag="{StaticResource ri-folder-shared-line}"
                            Name="BtnOpenFolder">
                                Open folder
                            </Button>
                            <Button Template="{StaticResource ToolbarButtonTemplate}" 
                            Padding="12,10" 
                            IsEnabled="False" 
                            Tag="{StaticResource ri-pause-line}" 
                            Name="BtnPause">
                                Pause
                            </Button>
                            <Button Template="{StaticResource ToolbarButtonTemplate}" 
                            Padding="12,10" 
                            IsEnabled="False" 
                            Tag="{StaticResource ri-play-line}"
                            Name="BtnResume"
                            >
                                Resume
                            </Button>-->
                            <Button 
                                Visibility="Collapsed"
                                Background="{StaticResource ControlBackcolor}"
                                Foreground="{StaticResource ToolButtonForecolor}"
                                BorderThickness="0"
                                Margin="0"
                                Padding="10,12" 
                                Name="BtnOpen">
                                <StackPanel Orientation="Horizontal">
                                    <Path 
                                        VerticalAlignment="Center"  Margin="0,0,10,0" Width="14" Height="14" Stretch="Uniform" StrokeThickness="0"
                                        Fill="{StaticResource ToolButtonForecolor}" Stroke="{StaticResource ToolButtonForecolor}"  SnapsToDevicePixels="True"
                                        Data="{StaticResource ri-mail-open-line}"/>
                                    <TextBlock Foreground="{StaticResource ToolButtonForecolor}" Text="{StaticResource CTX_OPEN_FILE}"/>
                                </StackPanel>
                            </Button>
                            <Button 
                                Background="{StaticResource ControlBackcolor}"
                                Foreground="{StaticResource ToolButtonForecolor}"
                                BorderThickness="0"
                                Margin="0"
                                Padding="10,12" 
                                Name="BtnOpenFolder">
                                <StackPanel Orientation="Horizontal">
                                    <Path 
                                        VerticalAlignment="Center"  Margin="0,0,10,0" Width="14" Height="14" Stretch="Uniform" StrokeThickness="0"
                                        Fill="{StaticResource ToolButtonForecolor}" Stroke="{StaticResource ToolButtonForecolor}"  SnapsToDevicePixels="True"
                                        Data="{StaticResource ri-folder-shared-line}"/>
                                    <TextBlock Foreground="{StaticResource ToolButtonForecolor}" Text="{StaticResource CTX_OPEN_FOLDER}"/>
                                </StackPanel>
                            </Button>
                            <Button 
                                Background="{StaticResource ControlBackcolor}"
                                Foreground="{StaticResource ToolButtonForecolor}"
                                BorderThickness="0"
                                Margin="0"
                                Padding="10,12" 
                                Name="BtnPause">
                                <StackPanel Orientation="Horizontal">
                                    <Path 
                                        VerticalAlignment="Center"  Margin="0,0,10,0" Width="14" Height="14" Stretch="Uniform" StrokeThickness="0"
                                        Fill="{StaticResource ToolButtonForecolor}" Stroke="{StaticResource ToolButtonForecolor}"  SnapsToDevicePixels="True"
                                        Data="{StaticResource ri-pause-line}"/>
                                    <TextBlock Foreground="{StaticResource ToolButtonForecolor}" Text="{StaticResource MENU_PAUSE}"/>
                                </StackPanel>
                            </Button>
                            <Button 
                                Background="{StaticResource ControlBackcolor}"
                                Foreground="{StaticResource ToolButtonForecolor}"
                                BorderThickness="0"
                                Margin="0"
                                Padding="10,12" 
                                Name="BtnResume">
                                <StackPanel Orientation="Horizontal">
                                    <Path 
                                        VerticalAlignment="Center"  Margin="0,0,10,0" Width="14" Height="14" Stretch="Uniform" StrokeThickness="0"
                                        Fill="{StaticResource ToolButtonForecolor}" Stroke="{StaticResource ToolButtonForecolor}"  SnapsToDevicePixels="True"
                                        Data="{StaticResource ri-play-line}"/>
                                    <TextBlock Foreground="{StaticResource ToolButtonForecolor}" Text="{StaticResource MENU_RESUME}"/>
                                </StackPanel>
                            </Button>
                        </StackPanel>
                        <StackPanel Grid.Column="1" Orientation="Horizontal" Margin="0,5" VerticalAlignment="Stretch" 
                                    Background="{StaticResource SearchBackcolor}">
                            <Border BorderBrush="{StaticResource SearchBorder}" BorderThickness="1" SnapsToDevicePixels="True">
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>
                                    </Grid.ColumnDefinitions>
                                    <TextBox Grid.Column="0" Name="TxtSearch"  AcceptsReturn="False"  
                                                TextWrapping="NoWrap" Width="100" VerticalContentAlignment="Center" 
                                                Padding="5,0"
                                                BorderThickness="0" Background="{StaticResource SearchBackcolor}"
                                                Foreground="{StaticResource TextForecolor}"/>
                                    <TextBlock Grid.Column="0" x:Name="Placeholder" IsHitTestVisible="False" 
                                       TextWrapping="NoWrap" Text="{StaticResource LBL_SEARCH}" VerticalAlignment="Center"  
                                       Background="{StaticResource SearchBackcolor}"
                                       Margin="10,5" 
                                       Foreground="{StaticResource PlaceHolderForecolor}">
                                        <TextBlock.Style>
                                            <Style TargetType="{x:Type TextBlock}">
                                                <Setter Property="Visibility" Value="Collapsed"/>
                                                <Style.Triggers>
                                                    <MultiDataTrigger>
                                                        <MultiDataTrigger.Conditions>
                                                            <Condition Binding="{Binding IsFocused, ElementName=TxtSearch}" Value="false" />
                                                            <Condition Binding="{Binding Text, ElementName=TxtSearch}" Value="" />
                                                        </MultiDataTrigger.Conditions>
                                                        <MultiDataTrigger.Setters>
                                                            <Setter Property="Visibility" Value="Visible"/>
                                                        </MultiDataTrigger.Setters>
                                                    </MultiDataTrigger>
                                                </Style.Triggers>
                                            </Style>
                                        </TextBlock.Style>
                                    </TextBlock>
                                    <Button Grid.Column="1" Padding="6,4" Margin="1"
                                            Background="{StaticResource SearchBackcolor}" BorderThickness="0" SnapsToDevicePixels="True"
                                            Click="SearchButton_Click">
                                        <Path VerticalAlignment="Center"  Margin="0,0,0,0" Width="12" Height="12" Stretch="Uniform" 
                                              StrokeThickness="0" Fill="{StaticResource ToolButtonForecolor}" 
                                              Stroke="{StaticResource ToolButtonForecolor}"  SnapsToDevicePixels="True" 
                                              Data="{StaticResource ri-search-line}"/>
                                    </Button>
                                </Grid>
                            </Border>
                        </StackPanel>
                        <Button Name="BtnMenu" Grid.Column="2" Padding="10,0" Margin="2,0,0,0" 
                                Background="{StaticResource ControlBackcolor}"
                                Foreground="{StaticResource ToolButtonForecolor}"
                                BorderThickness="0"
                                Click="BtnMenu_Click">
                            <Path VerticalAlignment="Center" Width="16" Height="16"  Margin="0,0,0,0" Stretch="Uniform" 
                                  StrokeThickness="0" Fill="{StaticResource ToolButtonForecolor}" 
                                  Stroke="{StaticResource ToolButtonForecolor}"  SnapsToDevicePixels="True"
                                  Data="{StaticResource  ri-menu-line}"/>
                        </Button>
                    </Grid>
                </Border>
                <Border BorderThickness="0,1,0,0" 
                    BorderBrush="{StaticResource ToolbarBordercolor}" 
                    DockPanel.Dock="Bottom" 
                    Background="{StaticResource StatusbarBackcolor}"
                    SnapsToDevicePixels="True"
                    Padding="5,5">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="auto"/>
                            <ColumnDefinition Width="auto"/>
                            <ColumnDefinition Width="auto"/>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="auto"/>
                        </Grid.ColumnDefinitions>
                        <TextBlock Padding="10,0,7,2" 
                               Foreground="{StaticResource ToolButtonForecolor}" 
                               Background="{StaticResource StatusbarBackcolor}"
                               VerticalAlignment="Center" Text="{StaticResource SETTINGS_MONITORING}"/>
                        <Button Grid.Column="1"  Name="BtnMonitoring" Foreground="{StaticResource ToolButtonForecolor}"
                            Margin="0" Padding="0" BorderThickness="0" Background="{StaticResource StatusbarBackcolor}"
                            Click="BtnMonitoring_Click">
                            <Path Name="MonitoringToggleIcon"
                                Height="24"
                                Width="24"
                                Margin="5,0"
                                VerticalAlignment="Center" 
                                StrokeThickness="0"
                                Stretch="None" 
                                Fill="{StaticResource StatusbarIconcolor}"
                                Stroke="{StaticResource StatusbarIconcolor}" 
                                Data="{StaticResource ri-toggle-line}"
                                SnapsToDevicePixels="True">
                            </Path>
                        </Button>
                        <Button Grid.Column="2" Name="BtnQueue" Foreground="{StaticResource ToolButtonForecolor}"
                            Margin="10,0" Padding="0" BorderThickness="0" Background="{StaticResource StatusbarBackcolor}"
                                Click="BtnQueue_Click">
                            <StackPanel Orientation="Horizontal" Margin="5,0,10,0">
                                <Path
                                Height="14"
                                Width="14"
                                Margin="5,0"
                                VerticalAlignment="Center" 
                                StrokeThickness="0"
                                Stretch="Fill" 
                                Fill="{StaticResource StatusbarIconcolor}"
                                Stroke="{StaticResource StatusbarIconcolor}" 
                                Data="{StaticResource ri-list-settings-fill}"
                                SnapsToDevicePixels="True"/>
                                <TextBlock Padding="3,0,3,2" VerticalAlignment="Center" Text="{StaticResource DESC_Q_TITLE}"/>
                            </StackPanel>
                        </Button>
                        <Button Name="BtnHelp" Grid.Column="4" Foreground="{StaticResource ToolButtonForecolor}"
                            Margin="0,0" Padding="0" BorderThickness="0" Background="{StaticResource StatusbarBackcolor}" Click="BtnHelp_Click">
                            <StackPanel Orientation="Horizontal" Margin="5,0,10,0">
                                <Path Name="PathHelp"
                                    Height="16"
                                    Width="16"
                                    Margin="5,0"
                                    VerticalAlignment="Center" 
                                    StrokeThickness="0"
                                    Stretch="Fill" 
                                    Fill="{StaticResource StatusbarIconcolor}"
                                    Stroke="{StaticResource StatusbarIconcolor}" 
                                    Data="{StaticResource ri-question-line}"
                                    SnapsToDevicePixels="True"/>
                                <TextBlock Padding="3,0,3,2" VerticalAlignment="Center" Name="TxtHelp" Text="{StaticResource LBL_SUPPORT_PAGE}"/>
                            </StackPanel>
                        </Button>
                    </Grid>
                </Border>
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>
                    <ListView Name="lvInProgress"
                              BorderThickness="0"
                          VerticalContentAlignment="Stretch" 
                          HorizontalAlignment="Stretch" 
                          Grid.Column="0" Grid.Row="0"
                          VirtualizingStackPanel.VirtualizationMode="Recycling"
                          GridViewColumnHeader.Click="lvInProgress_Click">
                        <ListView.View>
                            <GridView>
                                <GridViewColumn Width="200">
                                    <GridViewColumn.Header>
                                        <GridViewColumnHeader Tag="Name">
                                            <TextBlock Padding="40,0" Text="{StaticResource SORT_NAME}" />
                                        </GridViewColumnHeader>
                                    </GridViewColumn.Header>
                                    <GridViewColumn.CellTemplate>
                                        <DataTemplate>
                                            <StackPanel Orientation="Horizontal">
                                                <Path SnapsToDevicePixels="True" 
                                                  VerticalAlignment="Center" Margin="5,5" StrokeThickness="0" Stretch="None" Fill="{StaticResource ListViewIconForecolor}"
                                                  Width="24" Height="24" 
                                                  Data="{Binding Path=Name, Converter={StaticResource FileExtensionToVectorImageConverter}}"
                                                  />
                                                <TextBlock Text="{Binding Name}" Margin="5,5" VerticalAlignment="Center"></TextBlock>
                                            </StackPanel>
                                        </DataTemplate>
                                    </GridViewColumn.CellTemplate>
                                </GridViewColumn>
                                <GridViewColumn Width="80">
                                    <GridViewColumn.Header>
                                        <GridViewColumnHeader Tag="DateAdded" Name="lvInProgress_DateAdded">
                                            <TextBlock Text="{StaticResource SORT_DATE}"/>
                                        </GridViewColumnHeader>
                                    </GridViewColumn.Header>
                                    <GridViewColumn.CellTemplate>
                                        <DataTemplate>
                                            <TextBlock Text="{Binding DateAdded, StringFormat=d}"  />
                                        </DataTemplate>
                                    </GridViewColumn.CellTemplate>
                                </GridViewColumn>
                                <GridViewColumn Width="60" 
                                            DisplayMemberBinding="{Binding Size, Converter={StaticResource FileSizeValueConverter}}" >
                                    <GridViewColumn.Header>
                                        <GridViewColumnHeader Tag="Size">
                                            <TextBlock Text="{StaticResource SORT_SIZE}"/>
                                        </GridViewColumnHeader>
                                    </GridViewColumn.Header>
                                </GridViewColumn>
                                <GridViewColumn Header="%" Width="50" x:Name="p1" >
                                    <GridViewColumn.CellTemplate>
                                        <DataTemplate>
                                            <ProgressBar Width="{Binding Path=Width, ElementName=p1}" 
                                                     Value="{Binding Progress}" Height="5"
                                                     Maximum="100"   />
                                        </DataTemplate>
                                    </GridViewColumn.CellTemplate>
                                </GridViewColumn>
                                <GridViewColumn Header="{StaticResource SORT_STATUS}" Width="150" DisplayMemberBinding="{Binding StatusText}" />
                            </GridView>
                        </ListView.View>
                        <ListView.ItemContainerStyle>
                            <Style TargetType="{x:Type ListViewItem}" BasedOn="{StaticResource {x:Type ListViewItem}}">
                                <Setter Property="ContextMenu" Value="{StaticResource lvInProgressContextMenu}" />
                                <Setter Property="Padding" Value="0,0" />
                                <EventSetter Event="MouseDoubleClick" Handler="ListViewItem_MouseDoubleClick"/>
                            </Style>
                        </ListView.ItemContainerStyle>
                    </ListView>
                    <ListView Name="lvFinished"  
                          VerticalContentAlignment="Stretch" 
                              BorderThickness="0"
                          HorizontalAlignment="Stretch" 
                          Grid.Column="0" Grid.Row="0"
                          VirtualizingStackPanel.VirtualizationMode="Recycling"
                          GridViewColumnHeader.Click="lvFinished_Click">
                        <!--<ListView.Resources>
                            <ResourceDictionary>
                                <ResourceDictionary.MergedDictionaries>
                                    <ResourceDictionary Source="Resources/MainListViewStyles.xaml"/>
                                </ResourceDictionary.MergedDictionaries>
                            </ResourceDictionary>
                        </ListView.Resources>-->
                        <ListView.View>
                            <GridView>
                                <GridViewColumn  Width="400" >
                                    <GridViewColumn.Header>
                                        <GridViewColumnHeader Tag="Name">
                                            <TextBlock Padding="40,0" Text="{StaticResource SORT_NAME}"/>
                                        </GridViewColumnHeader>
                                    </GridViewColumn.Header>
                                    <GridViewColumn.CellTemplate>
                                        <DataTemplate>
                                            <StackPanel Orientation="Horizontal">
                                                <Path SnapsToDevicePixels="True" VerticalAlignment="Center" 
                                                  Margin="5,5" StrokeThickness="0" Stretch="None" 
                                                      Fill="{StaticResource ListViewIconForecolor}"
                                                  Width="24" Height="24"  
                                                  Data="{Binding Path=Name, Converter={StaticResource FileExtensionToVectorImageConverter}}"
                                                  />
                                                <TextBlock Text="{Binding Name}" Margin="5,5" VerticalAlignment="Center"></TextBlock>
                                            </StackPanel>
                                        </DataTemplate>
                                    </GridViewColumn.CellTemplate>
                                </GridViewColumn>
                                <GridViewColumn Width="80">
                                    <GridViewColumn.Header>
                                        <GridViewColumnHeader Tag="DateAdded" Name="lvFinished_DateAdded">
                                            <TextBlock Text="{StaticResource SORT_DATE}"/>
                                        </GridViewColumnHeader>
                                    </GridViewColumn.Header>
                                    <GridViewColumn.CellTemplate>
                                        <DataTemplate>
                                            <TextBlock Text="{Binding DateAdded, StringFormat=d}"  />
                                        </DataTemplate>
                                    </GridViewColumn.CellTemplate>
                                </GridViewColumn>
                                <GridViewColumn  Width="60"
                                    DisplayMemberBinding="{Binding Size, Converter={StaticResource FileSizeValueConverter}}" >
                                    <GridViewColumn.Header>
                                        <GridViewColumnHeader Tag="Size">
                                            <TextBlock Text="{StaticResource SORT_SIZE}"/>
                                        </GridViewColumnHeader>
                                    </GridViewColumn.Header>
                                </GridViewColumn>
                            </GridView>
                        </ListView.View>
                        <ListView.ItemContainerStyle>
                            <Style TargetType="{x:Type ListViewItem}" BasedOn="{StaticResource {x:Type ListViewItem}}">
                                <Setter Property="ContextMenu" Value="{StaticResource lvFinishedContextMenu}" />
                                <Setter Property="Padding" Value="0,0" />
                                <EventSetter Event="MouseDoubleClick" Handler="ListViewItem_MouseDoubleClick"/>
                            </Style>
                        </ListView.ItemContainerStyle>
                    </ListView>
                    <!--<Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition/>
                        </Grid.RowDefinitions>
                        <Path Grid.Row="1"
                                Height="96"
                                Width="96"
                                Margin="5,0"
                                VerticalAlignment="Center" 
                                StrokeThickness="0"
                                Stretch="Fill" 
                                Fill="{StaticResource ControlBackcolor}"
                                Stroke="{StaticResource ControlBackcolor}" 
                                Data="{StaticResource ri-folder-download-line}"
                                SnapsToDevicePixels="True"/>
                        <TextBlock FontSize="36" Grid.Row="2" TextAlignment="Center" Margin="10" 
                                   Foreground="{StaticResource ControlBackcolor}">No Downloads</TextBlock>
                    </Grid>-->
                </Grid>
            </DockPanel>
        </Grid>
    </Border>
</Window>
