Index: /extensions/PiwigoLib/Piwigo.sln
===================================================================
--- /extensions/PiwigoLib/Piwigo.sln	(revision 11903)
+++ /extensions/PiwigoLib/Piwigo.sln	(revision 11904)
@@ -1,5 +1,5 @@
 ﻿
 Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
+# Visual C# Express 2010
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PiwigoLib", "PiwigoLib\PiwigoLib.csproj", "{64C068C5-DBFE-4712-9081-B9100698F35C}"
 EndProject
@@ -40,4 +40,5 @@
 		{59F7FCF2-858A-406D-92A6-50514BD89B43}.Debug|Any CPU.ActiveCfg = Debug|x86
 		{59F7FCF2-858A-406D-92A6-50514BD89B43}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
+		{59F7FCF2-858A-406D-92A6-50514BD89B43}.Debug|Mixed Platforms.Build.0 = Debug|x86
 		{59F7FCF2-858A-406D-92A6-50514BD89B43}.Debug|x86.ActiveCfg = Debug|x86
 		{59F7FCF2-858A-406D-92A6-50514BD89B43}.Debug|x86.Build.0 = Debug|x86
Index: /extensions/PiwigoLib/PiwigoWpf/App.xaml
===================================================================
--- /extensions/PiwigoLib/PiwigoWpf/App.xaml	(revision 11903)
+++ /extensions/PiwigoLib/PiwigoWpf/App.xaml	(revision 11904)
@@ -6,7 +6,9 @@
              Exit="onAppExit">
     <Application.Resources>
-        <ObjectDataProvider x:Name="ImagesODP" x:Key="Images" ObjectType="{x:Type piwigo:PwgImageListWPF}" />
+        <ObjectDataProvider x:Name="ImagesODP" x:Key="Images" IsAsynchronous="True" ObjectType="{x:Type piwigo:PwgImageListWPF}" />
         <ObjectDataProvider x:Name="SessionODP" x:Key="Session" ObjectType="{x:Type piwigo:PwgSessionWPF}" />
-        <ObjectDataProvider x:Name="CategoriesODP" x:Key="Categories" ObjectType="{x:Type piwigo:PwgCategoryListWPF}" />
+        <ObjectDataProvider x:Name="CategoriesODP" x:Key="Categories" IsAsynchronous="True" ObjectType="{x:Type piwigo:PwgCategoryListWPF}" />
+        
+        <ResourceDictionary  x:Key="VisualStyleApp" Source="VisualStyleApp.xaml"/>
     </Application.Resources>
 </Application>
Index: /extensions/PiwigoLib/PiwigoWpf/Command/PwgCmdBase.cs
===================================================================
--- /extensions/PiwigoLib/PiwigoWpf/Command/PwgCmdBase.cs	(revision 11903)
+++ /extensions/PiwigoLib/PiwigoWpf/Command/PwgCmdBase.cs	(revision 11904)
@@ -12,5 +12,5 @@
        #region ICommand Membres
 
-       public abstract  Boolean CanExecute(object parameter);
+       public abstract  bool CanExecute(object parameter);
 
        public abstract void Execute(object parameter);
Index: /extensions/PiwigoLib/PiwigoWpf/Command/PwgCmdConnect.cs
===================================================================
--- /extensions/PiwigoLib/PiwigoWpf/Command/PwgCmdConnect.cs	(revision 11903)
+++ /extensions/PiwigoLib/PiwigoWpf/Command/PwgCmdConnect.cs	(revision 11904)
@@ -6,4 +6,5 @@
 using Com.Piwigo.Wpf.DTO.Helper;
 using Com.Piwigo.Wpf.Helper;
+using Com.Piwigo.Wpf.Service;
 
 namespace Com.Piwigo.Wpf.Command
@@ -11,5 +12,5 @@
     public sealed class PwgCmdConnect : PwgCmdBase
     {
-        public override Boolean CanExecute(object parameter)
+        public override bool CanExecute(object parameter)
         {
             Boolean retVal = false;
@@ -46,4 +47,6 @@
 
                 PwgCategoryListWPFHelper.ConvertPwgCategoryListToPwgCategoryListWPF(lstCat, ref lstCatWPF);
+
+                ImageCacheManager.Instance.SetCurrentServer(uriServer.AbsoluteUri);
             }
             catch (PwgServiceException ex)
Index: /extensions/PiwigoLib/PiwigoWpf/Command/PwgCmdGetImageforCategory.cs
===================================================================
--- /extensions/PiwigoLib/PiwigoWpf/Command/PwgCmdGetImageforCategory.cs	(revision 11904)
+++ /extensions/PiwigoLib/PiwigoWpf/Command/PwgCmdGetImageforCategory.cs	(revision 11904)
@@ -0,0 +1,60 @@
+﻿using System;
+using System.Collections.Generic;
+using Com.Piwigo.Lib.IService;
+using Com.Piwigo.Wpf.DTO;
+using Com.Piwigo.Lib.DTO;
+using Com.Piwigo.Wpf.DTO.Helper;
+using Com.Piwigo.Wpf.Helper;
+using Com.Piwigo.Wpf.Service;
+
+namespace Com.Piwigo.Wpf.Command
+{
+    public sealed class PwgCmdGetImageforCategory : PwgCmdBase
+    {
+        public override bool CanExecute(object parameter)
+        {
+            Boolean retVal = false;
+            if ( AppHelper.IsInDesignModeStatic == true)
+            {
+                retVal = false;
+            }
+            else
+            {
+                if ((PwgModelManager.Instance.Session != null)
+                    & (PwgModelManager.Instance.Session.ServeurName != null))
+                {
+                    retVal = !String.IsNullOrWhiteSpace(PwgModelManager.Instance.Session.ServeurName);
+                }
+            }
+            return (retVal);
+        }
+
+        public override void Execute(object parameter)
+        {
+            PwgCategoryWPF catParam;
+            Int32 aPage = 0;
+            Int32 aPerPage = 0;
+            Int32 acount = 0;
+
+            try {
+                Uri uriServer = new Uri(PwgModelManager.Instance.Session.ServeurName);
+                if (parameter is PwgCategoryWPF)
+                {
+                    catParam = (PwgCategoryWPF)parameter;
+
+                    List<PwgImage> lstImg = PwgServiceProvider.Instance.PwgCategoriesService.GetListOfImagesFormCategory(catParam.Id, false, null, null, null, null, null, null, null, null, null, null, null, null, null, true, ref aPage, ref aPerPage, ref  acount);
+                    PwgImageListWPF lstImgWPF = PwgModelManager.Instance.ImageList;
+
+                    PwgImageListWPFHelper.ConvertPwgImageListToPwgImageListWPF(lstImg, ref lstImgWPF);
+                }
+              
+            }
+            catch (PwgServiceException ex)
+            {
+                Console.WriteLine("Erreur " + ex.NumeroErr + " " + ex.MessageErr);
+                Console.WriteLine(ex.Message);
+            }
+
+        }
+    }
+}
Index: /extensions/PiwigoLib/PiwigoWpf/DTO/Helper/PwgImageListWPFHelper.cs
===================================================================
--- /extensions/PiwigoLib/PiwigoWpf/DTO/Helper/PwgImageListWPFHelper.cs	(revision 11904)
+++ /extensions/PiwigoLib/PiwigoWpf/DTO/Helper/PwgImageListWPFHelper.cs	(revision 11904)
@@ -0,0 +1,39 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Com.Piwigo.Lib.DTO;
+
+namespace Com.Piwigo.Wpf.DTO.Helper
+{
+    public static class PwgImageListWPFHelper
+    {
+        public static void AddPwgImageToList(PwgImage aPwgImage,
+                                                ref PwgImageListWPF aPwgImageListWPF)
+        {
+            if (aPwgImage != null)
+            {
+                if (aPwgImageListWPF == null)
+                {
+                    aPwgImageListWPF = new PwgImageListWPF();
+                }
+
+                PwgImageWPF pwgImg = new PwgImageWPF();
+                PwgImageWPFHelper.ConvertPwgImageToPwgImageWPF(aPwgImage, ref pwgImg);
+
+                aPwgImageListWPF.Add(pwgImg);
+            }
+        }
+
+        public static void ConvertPwgImageListToPwgImageListWPF(List<PwgImage> aPwgImageList, ref PwgImageListWPF aPwgImageListWPF)
+        {
+            if (aPwgImageList != null)
+            {
+                foreach (PwgImage pwgImg in aPwgImageList)
+                {
+                    AddPwgImageToList(pwgImg, ref aPwgImageListWPF);
+                }
+            }
+        }
+    }
+}
Index: /extensions/PiwigoLib/PiwigoWpf/DTO/Helper/PwgImageWPFHelper.cs
===================================================================
--- /extensions/PiwigoLib/PiwigoWpf/DTO/Helper/PwgImageWPFHelper.cs	(revision 11904)
+++ /extensions/PiwigoLib/PiwigoWpf/DTO/Helper/PwgImageWPFHelper.cs	(revision 11904)
@@ -0,0 +1,62 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Com.Piwigo.Lib.DTO;
+
+namespace Com.Piwigo.Wpf.DTO.Helper
+{
+    public static class PwgImageWPFHelper
+    {
+        public static void ConvertPwgImageToPwgImageWPF(PwgImage aPwgImage,
+                                                       ref PwgImageWPF aPwgImageWPF)
+        {
+            if (aPwgImage != null)
+            {
+                if (aPwgImageWPF == null)
+                {
+                    aPwgImageWPF = new PwgImageWPF();
+                }
+
+                aPwgImageWPF.Id = aPwgImage.Id;
+                aPwgImageWPF.Counter = aPwgImage.Counter;
+                aPwgImageWPF.File = aPwgImage.File;
+                aPwgImageWPF.Height = aPwgImage.Height;
+                aPwgImageWPF.UrlElement = aPwgImage.UrlElement;
+                aPwgImageWPF.UrlHighDef = aPwgImage.UrlHighDef;
+                aPwgImageWPF.UrlThunb = aPwgImage.UrlThunb;
+                aPwgImageWPF.Width = aPwgImage.Width;
+
+                if (aPwgImageWPF.Categories == null)
+                {
+                    aPwgImageWPF.Categories = new System.Collections.ObjectModel.ObservableCollection<PwgCategoryWPF>();
+                }
+                else
+                {
+                    aPwgImageWPF.Categories.Clear();
+                }
+
+                foreach (PwgCategoryWPF c in aPwgImageWPF.Categories)
+                {
+                    aPwgImageWPF.Categories.Add(c);
+                }
+
+                //if (aPwgImageWPF.Tags == null)
+                //{
+                //    aPwgImageWPF.Tags = new System.Collections.ObjectModel.ObservableCollection<PwgTag>();
+                //}
+                //else
+                //{
+                //    aPwgImageWPF.Tags.Clear();
+                //}
+
+                //foreach (PwgTag t in aPwgImageWPF.Tags)
+                //{
+                //    aPwgImageWPF.Tags.Add(t);
+                //}
+
+            }
+
+        }
+    }
+}
Index: /extensions/PiwigoLib/PiwigoWpf/DTO/PwgModelManager.cs
===================================================================
--- /extensions/PiwigoLib/PiwigoWpf/DTO/PwgModelManager.cs	(revision 11904)
+++ /extensions/PiwigoLib/PiwigoWpf/DTO/PwgModelManager.cs	(revision 11904)
@@ -0,0 +1,34 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Com.Piwigo.Wpf.DTO
+{
+    public sealed class PwgModelManager
+    {
+        static readonly PwgModelManagerBase _instance = new PwgModelManagerBase();
+
+        // Explicit static constructor to tell C# compiler
+        // not to mark type as beforefieldinit
+        static PwgModelManager()
+        {
+        }
+
+        public static PwgModelManagerBase Instance
+        {
+            get
+            {
+                return _instance;
+            }
+        }
+
+        public class PwgModelManagerBase
+        {
+            public PwgImageListWPF ImageList { get; set; }
+            public PwgSessionWPF Session { get; set; }
+            public PwgCategoryListWPF CategoryList { get; set; }
+        }
+
+    }
+}
Index: /extensions/PiwigoLib/PiwigoWpf/Helper/AppHelper.cs
===================================================================
--- /extensions/PiwigoLib/PiwigoWpf/Helper/AppHelper.cs	(revision 11903)
+++ /extensions/PiwigoLib/PiwigoWpf/Helper/AppHelper.cs	(revision 11904)
@@ -6,4 +6,6 @@
 using System.Windows;
 using System.Diagnostics.CodeAnalysis;
+using System.Windows.Input;
+using Com.Piwigo.Wpf.Command;
 
 namespace Com.Piwigo.Wpf.Helper
@@ -11,5 +13,5 @@
     public class AppHelper
     {
-        private static Boolean? _isInDesignMode;
+        private static bool? _isInDesignMode;
 
         /// <summary>
@@ -17,5 +19,5 @@
         /// or Visual Studio).
         /// </summary>
-        public static Boolean IsInDesignModeStatic
+        public static bool IsInDesignModeStatic
         {
             get
@@ -25,5 +27,5 @@
                     var prop = DesignerProperties.IsInDesignModeProperty;
                     _isInDesignMode
-                        = (Boolean)DependencyPropertyDescriptor
+                        = (bool)DependencyPropertyDescriptor
                         .FromProperty(prop, typeof(FrameworkElement))
                         .Metadata.DefaultValue;
@@ -42,5 +44,5 @@
             "CA1822:MarkMembersAsStatic",
             Justification = "Non static member needed for data binding")]
-        public Boolean IsInDesignMode
+        public bool IsInDesignMode
         {
             get
@@ -50,5 +52,14 @@
         }
 
+        static public void ExecuteCommand<T>(object parameter) where T:  PwgCmdBase, new()
+        {
+            T cmd = new T();
+            if (cmd.CanExecute(parameter))
+            {
+                cmd.Execute(parameter);
+            }
+        }
     }
 
+
 }
Index: /extensions/PiwigoLib/PiwigoWpf/Helper/ImageUrlCachedConverter.cs
===================================================================
--- /extensions/PiwigoLib/PiwigoWpf/Helper/ImageUrlCachedConverter.cs	(revision 11904)
+++ /extensions/PiwigoLib/PiwigoWpf/Helper/ImageUrlCachedConverter.cs	(revision 11904)
@@ -0,0 +1,38 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Globalization;
+using System.Windows.Media.Imaging;
+using System.Windows.Controls;
+using Com.Piwigo.Wpf.DTO;
+using System.IO;
+using System.Threading;
+using System.Windows.Threading;
+using System.Windows.Data;
+using Com.Piwigo.Wpf.Service;
+
+
+namespace Com.Piwigo.Wpf.Helper
+{
+    [ValueConversion(typeof(PwgImageWPF), typeof(String))] 
+    public class ImageUrlCachedConverter : IValueConverter
+    {
+         public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            String src;
+            if (value == null) return null;
+            PwgImageWPF someObj = value as PwgImageWPF;
+
+            src = ImageCacheManager.Instance.GetImageFilename(someObj);
+
+            return src;
+        }
+
+        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            throw new NotImplementedException();
+        }
+    }
+}
+
Index: /extensions/PiwigoLib/PiwigoWpf/MainWindow.xaml
===================================================================
--- /extensions/PiwigoLib/PiwigoWpf/MainWindow.xaml	(revision 11903)
+++ /extensions/PiwigoLib/PiwigoWpf/MainWindow.xaml	(revision 11904)
@@ -5,138 +5,122 @@
         xmlns:pwgdto="clr-namespace:Com.Piwigo.Wpf.DTO"
         xmlns:pwgcmd="clr-namespace:Com.Piwigo.Wpf.Command"
+        xmlns:pwgsrv="clr-namespace:Com.Piwigo.Wpf.Service"
         Title="PiwigoWpf"
         WindowState="Maximized"
         MinHeight="600" MinWidth="800">
     <Window.Resources>
-        <LinearGradientBrush x:Key="WindowGradient" StartPoint="0,0.3" EndPoint="1,0">
-            <LinearGradientBrush.GradientStops>
-                <GradientStop Color="#B2B6CAFF" Offset="0" />
-                <GradientStop Color="#BFC3D5FF" Offset="0.1" />
-                <GradientStop Color="#E0E4F0FF" Offset="0.3" />
-                <GradientStop Color="#E6EAF5FF" Offset="0.5" />
-                <GradientStop Color="#CFD7E2FF" Offset="0.6" />
-                <GradientStop Color="#BFC5D3FF" Offset="0.8" />
-                <GradientStop Color="#C4CBD8FF" Offset="1" />
-            </LinearGradientBrush.GradientStops>
-        </LinearGradientBrush>
-
-        <LinearGradientBrush x:Key="ListBoxGradient" StartPoint="0,0" EndPoint="0,1">
-            <LinearGradientBrush.GradientStops>
-                <GradientStop Color="#90000000" Offset="0" />
-                <GradientStop Color="#40000000" Offset="0.005" />
-                <GradientStop Color="#10000000" Offset="0.04" />
-                <GradientStop Color="#20000000" Offset="0.945" />
-                <GradientStop Color="#60FFFFFF" Offset="1" />
-            </LinearGradientBrush.GradientStops>
-        </LinearGradientBrush>
-
-        <LinearGradientBrush x:Key="ShoppingCartGradient" StartPoint="0,0" EndPoint="0,1">
-            <LinearGradientBrush.GradientStops>
-                <GradientStop Color="#90000000" Offset="0" />
-                <GradientStop Color="#40000000" Offset="0.002" />
-                <GradientStop Color="#10000000" Offset="0.02" />
-                <GradientStop Color="#20000000" Offset="0.98" />
-                <GradientStop Color="#60FFFFFF" Offset="1" />
-            </LinearGradientBrush.GradientStops>
-        </LinearGradientBrush>
-
-        <LinearGradientBrush x:Key="ReflectionGradient" StartPoint="0,1" EndPoint="0,0">
-            <LinearGradientBrush.GradientStops>
-                <GradientStop Color="#50000000" Offset="0" />
-                <GradientStop Color="Transparent" Offset=".5" />
-            </LinearGradientBrush.GradientStops>
-        </LinearGradientBrush>
-
-        <LinearGradientBrush x:Key="ButtonGradient" StartPoint="0,0" EndPoint="0,1">
-            <LinearGradientBrush.GradientStops>
-                <GradientStop Color="#FDB6CADF" Offset="0" />
-                <GradientStop Color="#FCC3C5FF" Offset="0.1" />
-                <GradientStop Color="#FCC4D0EF" Offset="0.3" />
-                <GradientStop Color="#FDB7C2DF" Offset="0.6" />
-                <GradientStop Color="#FE95B3CF" Offset="0.8" />
-                <GradientStop Color="#FE96AACF" Offset="1" />
-            </LinearGradientBrush.GradientStops>
-        </LinearGradientBrush>
-
-        <LinearGradientBrush x:Key="VerticalScrollGradient" StartPoint="0,0" EndPoint="1,0">
-            <LinearGradientBrush.GradientStops>
-                <GradientStop Color="#FDB6CADF" Offset="0" />
-                <GradientStop Color="#FCC3C5FF" Offset="0.1" />
-                <GradientStop Color="#FCC4D0EF" Offset="0.3" />
-                <GradientStop Color="#FDB7C2DF" Offset="0.6" />
-                <GradientStop Color="#FE95B3CF" Offset="0.8" />
-                <GradientStop Color="#FE96AACF" Offset="1" />
-            </LinearGradientBrush.GradientStops>
-        </LinearGradientBrush>
-
-        <LinearGradientBrush x:Key="ComboBoxGradient" StartPoint="0,0" EndPoint="0,1">
-            <LinearGradientBrush.GradientStops>
-                <GradientStop Color="#B2B6CAFF" Offset="0" />
-                <GradientStop Color="#B0B3C5FF" Offset="0.1" />
-                <GradientStop Color="#BEE4E0FF" Offset="0.3" />
-                <GradientStop Color="#B0D7E2FF" Offset="0.6" />
-                <GradientStop Color="#B0C5D3FF" Offset="0.8" />
-                <GradientStop Color="#C4CBD8FF" Offset="1" />
-            </LinearGradientBrush.GradientStops>
-        </LinearGradientBrush>
-
-        <LinearGradientBrush x:Key="GreetingCardGradient" StartPoint="0,0" EndPoint="0,1">
-            <LinearGradientBrush.GradientStops>
-                <GradientStop Color="#EEEEEE" Offset="0" />
-                <GradientStop Color="#FFFFFF" Offset="1" />
-            </LinearGradientBrush.GradientStops>
-        </LinearGradientBrush>
-
-        <LinearGradientBrush x:Key="ButtonUpGradient" StartPoint="0,0" EndPoint="0,1">
-            <LinearGradientBrush.GradientStops>
-                <GradientStop Color="Transparent" Offset="0" />
-                <GradientStop Color="#33000000" Offset="1" />
-            </LinearGradientBrush.GradientStops>
-        </LinearGradientBrush>
-
-        <LinearGradientBrush x:Key="ButtonDownGradient" StartPoint="0,0" EndPoint="0,1">
-            <LinearGradientBrush.GradientStops>
-                <GradientStop Color="#10000000" Offset="0" />
-                <GradientStop Color="#20000000" Offset="1" />
-            </LinearGradientBrush.GradientStops>
-        </LinearGradientBrush>
-
-        <LinearGradientBrush x:Key="ButtonDisabledGradient" StartPoint="0,0" EndPoint="0,1">
-            <LinearGradientBrush.GradientStops>
-                <GradientStop Color="#10302A90" Offset="0" />
-                <GradientStop Color="#10201040" Offset="1" />
-            </LinearGradientBrush.GradientStops>
-        </LinearGradientBrush>
-
-        <!-- STYLES -->
-
-        <Style TargetType="{x:Type pwg:MainWindow}">
-            <Setter Property="Background" Value="{DynamicResource WindowGradient}" />
-        </Style>
-
-        <Style x:Key="TitleText" TargetType="{x:Type TextBlock}" >
-            <Setter Property="FontFamily" Value="Segoe Black" />
-            <Setter Property="FontSize" Value="20px" />
-            <Setter Property="Foreground" Value="MidnightBlue" />
-        </Style>
-
-        <!-- DATA TEMPLATES -->
+        <ObjectDataProvider x:Key="listCat" IsAsynchronous="True" />
+        <ObjectDataProvider x:Key="listImg" IsAsynchronous="True" />
+
+              <!-- DATA TEMPLATES -->
 
         <DataTemplate DataType="{x:Type pwgdto:PwgImageWPF}">
             <Border VerticalAlignment="Center" HorizontalAlignment="Center" Padding="4" Margin="2" Background="Blue"
-                    DataContext="{Binding}">
-                <Image Source="{Binding UrlElement}" ToolTip="{Binding File}" />
+                    DataContext="{Binding}"><!--Source="{Binding UrlElement}"-->
+                <Image ToolTip="{Binding File}" >
+                    <Image.Source>
+                        <PriorityBinding FallbackValue="pack://application:,,,/Pictures/Globe.png">
+                            <Binding IsAsync="True" Converter="{x:Static pwgsrv:ImageCacheManager.ImageUrlCachedConverter}"/>
+                            
+                    </PriorityBinding>
+                    </Image.Source>
+                </Image>
             </Border>
         </DataTemplate>
 
-        <DataTemplate DataType="{x:Type pwgdto:PwgCategoryWPF}">
-            <Border VerticalAlignment="Center" HorizontalAlignment="Center" Padding="4" Margin="2" Background="Blue"
-                    DataContext="{Binding}">                
-                <TextBox ToolTip="{Binding Name}" />
+        <DataTemplate DataType="{x:Type pwgdto:PwgCategoryWPF}"  >
+            <Border VerticalAlignment="Center" HorizontalAlignment="Center" 
+                    Padding="4" Margin="1" 
+                    Background="LightBlue"
+                    DataContext="{Binding}">
+                <StackPanel Orientation="Vertical" DataContext="{Binding}" VerticalAlignment="Center" >
+                    <Image Source="pack://application:,,,/Pictures/folder_images.png" 
+                           Stretch="Uniform"
+                           MaxHeight="128"
+                           MaxWidth="128">
+                        <Image.ToolTip>
+                            <StackPanel Orientation="Vertical">
+                            <StackPanel Orientation="Horizontal">
+                                <TextBlock Text="{Binding Path=ImagesCount}"/>
+                                <TextBlock Text=" images inside"/>
+                            </StackPanel>
+                                <StackPanel Orientation="Horizontal">
+                                    <TextBlock Text="{Binding Path=SubCategoriesCount}"/>
+                                    <TextBlock Text=" categories inside"/>
+                                </StackPanel>
+                            </StackPanel>
+                        </Image.ToolTip>
+                    </Image>
+                    <TextBlock Text="{Binding Name}" />
+                </StackPanel>
             </Border>
         </DataTemplate>
 
+        <Style x:Key="CategoryListStyle" TargetType="{x:Type ListBox}">
+            <Setter Property="Template">
+                <Setter.Value>
+                    <ControlTemplate TargetType="{x:Type ListBox}" >
+                        <Border 
+							BorderBrush="Gray" 
+							BorderThickness="1" 
+							CornerRadius="6" 
+                            Background="LightBlue"                            
+							 >
+                            <!--Background="{DynamicResource ListBoxGradient}"-->
+                            <ScrollViewer 
+								VerticalScrollBarVisibility="Auto" 
+								HorizontalScrollBarVisibility="Disabled">
+                                <StackPanel  
+									IsItemsHost="True" 
+									Orientation="Vertical" 
+									HorizontalAlignment="Center"
+                                    VerticalAlignment="Top"/>
+                            </ScrollViewer>
+                        </Border>
+                    </ControlTemplate>
+                </Setter.Value>
+            </Setter>
+        </Style>
+
+        <Style x:Key="CategoryListItem" TargetType="{x:Type ListBoxItem}">
+            <Setter Property="MaxHeight" Value="128" />
+            <Setter Property="MinHeight" Value="128" />
+            <Setter Property="Opacity" Value=".75" />
+            <Style.Triggers>
+                <EventTrigger RoutedEvent="Mouse.MouseEnter">
+                    <EventTrigger.Actions>
+                        <BeginStoryboard>
+                            <Storyboard>
+                                <DoubleAnimation 
+									Duration="0:0:0.2" 
+									Storyboard.TargetProperty="MaxHeight" 
+									To="220" />
+                                <DoubleAnimation 
+									Duration="0:0:0.2" 
+									Storyboard.TargetProperty="Opacity"
+									To="1.0" />
+                            </Storyboard>
+                        </BeginStoryboard>
+                    </EventTrigger.Actions>
+                </EventTrigger>
+
+                <EventTrigger RoutedEvent="Mouse.MouseLeave">
+                    <EventTrigger.Actions>
+                        <BeginStoryboard>
+                            <Storyboard>
+                                <DoubleAnimation 
+									Duration="0:0:1" 
+									Storyboard.TargetProperty="MaxHeight" />
+                                <DoubleAnimation 
+									Duration="0:0:0.2" 
+									Storyboard.TargetProperty="Opacity" />
+                            </Storyboard>
+                        </BeginStoryboard>
+                    </EventTrigger.Actions>
+                </EventTrigger>
+            </Style.Triggers>
+        </Style>
         <!-- PHOTOLIST TEMPLATE -->
-
+        
         <Style x:Key="PhotoListStyle" TargetType="{x:Type ListBox}">
             <Setter Property="Template">
@@ -147,5 +131,7 @@
 							BorderThickness="1" 
 							CornerRadius="6" 
-							Background="{DynamicResource ListBoxGradient}" >
+                            Background="LightBlue"                            
+							 >
+                            <!--Background="{DynamicResource ListBoxGradient}"-->
                             <ScrollViewer 
 								VerticalScrollBarVisibility="Disabled" 
@@ -203,214 +189,8 @@
         </Style>
 
-        <!-- BUTTON TEMPLATE -->
-
-        <Style TargetType="{x:Type Button}">
-            <Setter Property="Template">
-                <Setter.Value>
-                    <ControlTemplate TargetType="{x:Type Button}">
-                        <Border x:Name="OuterBorder"
-							CornerRadius="3" 
-							Background="{DynamicResource ButtonGradient}">
-                            <Border
-								x:Name="InnerBorder"
-								CornerRadius="3"
-								Background="{DynamicResource ButtonUpGradient}"
-								Padding="{TemplateBinding Padding}">
-                                <ContentPresenter x:Name="ContentSite" 
-								HorizontalAlignment="Center" 
-								VerticalAlignment="Center" />
-                            </Border>
-                        </Border>
-                        <ControlTemplate.Triggers>
-                            <Trigger Property="IsPressed" Value="true">
-                                <Setter TargetName="InnerBorder" Property="Background" Value="{DynamicResource ButtonDownGradient}" />
-                            </Trigger>
-                            <Trigger Property="IsEnabled" Value="false">
-                                <Setter TargetName="InnerBorder" Property="Background" Value="{DynamicResource ButtonDisabledGradient}"  />
-                                <Setter Property="BorderBrush" Value="Silver"  />
-                                <Setter Property="Foreground" Value="SlateGray"  />
-                            </Trigger>
-                        </ControlTemplate.Triggers>
-                    </ControlTemplate>
-                </Setter.Value>
-            </Setter>
-            <Setter Property="Height" Value="18" />
-            <Setter Property="Foreground" Value="MidnightBlue" />
-        </Style>
-
-        <!-- COMBOBOX STYLE -->
-
-        <Style TargetType="{x:Type ComboBox}" >
-            <Setter Property="Background" Value="{DynamicResource ComboBoxGradient}" />
-            <Setter Property="BorderThickness" Value="0" />
-            <Setter Property="Height" Value="18px" />
-            <Setter Property="Foreground" Value="MidnightBlue" />
-        </Style>
-
-        <!-- PROGRESS BAR STYLE -->
-
-        <Style TargetType="{x:Type ProgressBar}" >
-            <Setter Property="Background" Value="{DynamicResource ComboBoxGradient}" />
-            <Setter Property="BorderThickness" Value="1" />
-            <Setter Property="BorderBrush" Value="Gray" />
-            <Setter Property="Foreground" Value="MidnightBlue" />
-        </Style>
-
-        <!-- SCROLLBAR TEMPLATES -->
-
-        <Style x:Key="Scrollbar_LineButton" TargetType="{x:Type RepeatButton}">
-            <Setter Property="Template">
-                <Setter.Value>
-                    <ControlTemplate TargetType="{x:Type RepeatButton}">
-                        <Border 
-							BorderBrush="Transparent" 
-							BorderThickness="1" 
-							CornerRadius="6" 
-							Background="{DynamicResource ButtonGradient}">
-                            <ContentPresenter x:Name="ContentSite" />
-                        </Border>
-                    </ControlTemplate>
-                </Setter.Value>
-            </Setter>
-            <Setter Property="MinHeight" Value="12" />
-            <Setter Property="MinWidth" Value="12" />
-            <Setter Property="Foreground" Value="Gray" />
-            <Setter Property="FontSize" Value="6pt" />
-            <Setter Property="FontWeight" Value="Bold" />
-            <Setter Property="FontFamily" Value="Lucida Sans" />
-            <Setter Property="VerticalAlignment" Value="Center" />
-            <Setter Property="HorizontalAlignment" Value="Center" />
-        </Style>
-
-        <Style x:Key="ScrollBar_TrackRepeater"  TargetType="{x:Type RepeatButton}">
-            <Setter Property="IsTabStop" Value="false" />
-            <Setter Property="Focusable" Value="false" />
-            <Setter Property="Command" Value="ScrollBar.PageUpCommand" />
-            <Setter Property="Template">
-                <Setter.Value>
-                    <ControlTemplate TargetType="{x:Type RepeatButton}">
-                        <Rectangle Fill="Transparent" />
-                    </ControlTemplate>
-                </Setter.Value>
-            </Setter>
-        </Style>
-
-        <Style x:Key="ScrollBar_UpTrack" BasedOn="{StaticResource ScrollBar_TrackRepeater}" TargetType="{x:Type RepeatButton}">
-            <Setter Property="Command" Value="ScrollBar.PageUpCommand" />
-        </Style>
-
-        <Style x:Key="ScrollBar_DownTrack" BasedOn="{StaticResource ScrollBar_TrackRepeater}" TargetType="{x:Type RepeatButton}">
-            <Setter Property="Command" Value="ScrollBar.PageDownCommand" />
-        </Style>
-
-        <Style x:Key="ScrollBar_LeftTrack" BasedOn="{StaticResource ScrollBar_TrackRepeater}" TargetType="{x:Type RepeatButton}">
-            <Setter Property="Command" Value="ScrollBar.PageLeftCommand" />
-        </Style>
-
-        <Style x:Key="ScrollBar_RightTrack" BasedOn="{StaticResource ScrollBar_TrackRepeater}" TargetType="{x:Type RepeatButton}">
-            <Setter Property="Command" Value="ScrollBar.PageRightCommand" />
-        </Style>
-
-        <Style x:Key="ScrollBar_VerticalThumb" TargetType="{x:Type Thumb}">
-            <Setter Property="Template">
-                <Setter.Value>
-                    <ControlTemplate TargetType="{x:Type Thumb}">
-                        <Border CornerRadius="6" 
-							BorderBrush="Transparent"     
-							BorderThickness="1" 
-							Background="{DynamicResource VerticalScrollGradient}" />
-                    </ControlTemplate>
-                </Setter.Value>
-            </Setter>
-            <Setter Property="MinHeight" Value="10" />
-            <Setter Property="MinWidth" Value="10" />
-        </Style>
-
-        <Style x:Key="ScrollBar_HorizontalThumb" TargetType="{x:Type Thumb}">
-            <Setter Property="Template">
-                <Setter.Value>
-                    <ControlTemplate TargetType="{x:Type Thumb}">
-                        <Border CornerRadius="6" 
-							BorderBrush="Transparent"     
-							BorderThickness="1" 
-							Background="{DynamicResource ButtonGradient}" />
-                    </ControlTemplate>
-                </Setter.Value>
-            </Setter>
-            <Setter Property="MinHeight" Value="10" />
-            <Setter Property="MinWidth" Value="10" />
-        </Style>
-
-        <Style TargetType="{x:Type ScrollBar}">
-            <Setter Property="Background" Value="Transparent" />
-            <Setter Property="MinWidth" Value="10" />
-            <Setter Property="Template">
-                <Setter.Value>
-                    <ControlTemplate TargetType="{x:Type ScrollBar}">
-                        <Grid>
-                            <Grid.ColumnDefinitions>
-                                <ColumnDefinition Width="10"/>
-                            </Grid.ColumnDefinitions>
-                            <Grid.RowDefinitions>
-                                <RowDefinition Height="10" />
-                                <RowDefinition Height="*"/>
-                                <RowDefinition Height="10" />
-                            </Grid.RowDefinitions>
-                            <Border Grid.Row="1" BorderThickness="0" Background="Transparent" CornerRadius="4"/>
-                            <RepeatButton Grid.Row="0" Style="{DynamicResource Scrollbar_LineButton}" Command="ScrollBar.LineUpCommand" Content=" ^" />
-                            <Track Grid.Row="1" Name="PART_Track"  IsDirectionReversed="True">
-                                <Track.IncreaseRepeatButton>
-                                    <RepeatButton Style="{DynamicResource ScrollBar_DownTrack}"/>
-                                </Track.IncreaseRepeatButton>
-                                <Track.DecreaseRepeatButton>
-                                    <RepeatButton Style="{DynamicResource ScrollBar_UpTrack}"/>
-                                </Track.DecreaseRepeatButton>
-                                <Track.Thumb>
-                                    <Thumb Style="{DynamicResource ScrollBar_VerticalThumb}"/>
-                                </Track.Thumb>
-                            </Track>
-                            <RepeatButton Grid.Row="2" Style="{DynamicResource Scrollbar_LineButton}" Command="ScrollBar.LineDownCommand" Content=" v" />
-                        </Grid>
-                    </ControlTemplate>
-                </Setter.Value>
-            </Setter>
-            <Style.Triggers>
-                <Trigger Property="Orientation" Value="Horizontal" >
-                    <Setter Property="Background" Value="Transparent" />
-                    <Setter Property="MinHeight" Value="10" />
-                    <Setter Property="Template">
-                        <Setter.Value>
-                            <ControlTemplate TargetType="{x:Type ScrollBar}">
-                                <Grid>
-                                    <Grid.RowDefinitions>
-                                        <RowDefinition Height="12"/>
-                                    </Grid.RowDefinitions>
-                                    <Grid.ColumnDefinitions>
-                                        <ColumnDefinition Width="12" />
-                                        <ColumnDefinition Width="*"/>
-                                        <ColumnDefinition Width="12" />
-                                    </Grid.ColumnDefinitions>
-                                    <Border Grid.Column="1" BorderThickness="0" Background="Transparent" CornerRadius="4"/>
-                                    <RepeatButton Grid.Column="0" Style="{DynamicResource Scrollbar_LineButton}" Command="ScrollBar.LineLeftCommand" Content=" &lt;" />
-                                    <Track Grid.Column="1" Name="PART_Track">
-                                        <Track.IncreaseRepeatButton>
-                                            <RepeatButton Style="{DynamicResource ScrollBar_RightTrack}"/>
-                                        </Track.IncreaseRepeatButton>
-                                        <Track.DecreaseRepeatButton>
-                                            <RepeatButton Style="{DynamicResource ScrollBar_LeftTrack}"/>
-                                        </Track.DecreaseRepeatButton>
-                                        <Track.Thumb>
-                                            <Thumb Style="{DynamicResource ScrollBar_HorizontalThumb}"/>
-                                        </Track.Thumb>
-                                    </Track>
-                                    <RepeatButton Grid.Column="2" Style="{DynamicResource Scrollbar_LineButton}" Command="ScrollBar.LineRightCommand" Content=" &gt;" />
-
-                                </Grid>
-                            </ControlTemplate>
-                        </Setter.Value>
-                    </Setter>
-                </Trigger>
-            </Style.Triggers>
-        </Style>
+        <!--<Style TargetType="{x:Type pwg:MainWindow}">
+            <Setter Property="Background" Value="{DynamicResource WindowGradient}" />
+        </Style>-->
+
     </Window.Resources>
     <DockPanel Name="mainDockPanel"  Margin="5">
@@ -418,5 +198,5 @@
             <Image Name="ImgPiwigoLogo" MinHeight="50" MinWidth="50"
                    Source="pack://application:,,,/Pictures/PiwigoLogo.png" 
-                   ToolTip="www.piwigo.org" Stretch="None" />
+                   ToolTip="www.piwigo.org" Stretch="None" HorizontalAlignment="Left" />
             <StackPanel Name="connectStackPanel" Orientation="Horizontal" VerticalAlignment="Center"  Margin="5"
                         DataContext="{Binding Source={StaticResource Session}}">
@@ -433,6 +213,14 @@
         </StackPanel>
 
-        <ListView Name="listViewCategory" Style="PhotoListStyle" DockPanel.Dock="Left" MinWidth="100" ItemsSource="{Binding Source={StaticResource Categories}}" />
-        <ListView Name="listViewImage" Style="PhotoListStyle" DockPanel.Dock="Right"  MinWidth="500" ItemsSource="{Binding Source={StaticResource Images}}" />
+        <ListView Name="listViewCategory"  DockPanel.Dock="Left" MinWidth="100" 
+                  Style="{DynamicResource CategoryListStyle}"
+                  ItemContainerStyle="{DynamicResource CategoryListItem}" 
+                  DataContext="{Binding Source={StaticResource Categories}}" 
+                  ItemsSource="{Binding }" MouseDoubleClick="listViewCategory_MouseDoubleClick" />
+        <ListView Name="listViewImage"  DockPanel.Dock="Right"  MinWidth="500"
+                  Style="{DynamicResource PhotoListStyle}"
+                  ItemContainerStyle="{DynamicResource PhotoListItem}" 
+                  DataContext="{Binding Source={StaticResource Images}}" 
+                  ItemsSource="{Binding }" />
     </DockPanel>
     
Index: /extensions/PiwigoLib/PiwigoWpf/MainWindow.xaml.cs
===================================================================
--- /extensions/PiwigoLib/PiwigoWpf/MainWindow.xaml.cs	(revision 11903)
+++ /extensions/PiwigoLib/PiwigoWpf/MainWindow.xaml.cs	(revision 11904)
@@ -12,4 +12,6 @@
 using System.Windows.Navigation;
 using System.Windows.Shapes;
+using Com.Piwigo.Wpf.Helper;
+using Com.Piwigo.Wpf.Command;
 
 namespace Com.Piwigo.Wpf
@@ -24,4 +26,9 @@
             InitializeComponent();
         }
+
+        private void listViewCategory_MouseDoubleClick(object sender, MouseButtonEventArgs e)
+        {
+            AppHelper.ExecuteCommand<PwgCmdGetImageforCategory>(listViewCategory.SelectedValue);
+        }
     }
 }
Index: /extensions/PiwigoLib/PiwigoWpf/PiwigoWpf.csproj
===================================================================
--- /extensions/PiwigoLib/PiwigoWpf/PiwigoWpf.csproj	(revision 11903)
+++ /extensions/PiwigoLib/PiwigoWpf/PiwigoWpf.csproj	(revision 11904)
@@ -59,4 +59,5 @@
     <Reference Include="System.Data" />
     <Reference Include="System.Drawing" />
+    <Reference Include="System.Web" />
     <Reference Include="System.Xml" />
     <Reference Include="Microsoft.CSharp" />
@@ -76,7 +77,10 @@
       <SubType>Designer</SubType>
     </ApplicationDefinition>
+    <Compile Include="Command\PwgCmdGetImageforCategory.cs" />
     <Compile Include="Command\PwgCmdProvider.cs" />
     <Compile Include="Command\PwgCmdConnect.cs" />
     <Compile Include="Command\PwgCmdBase.cs" />
+    <Compile Include="DTO\Helper\PwgImageListWPFHelper.cs" />
+    <Compile Include="DTO\Helper\PwgImageWPFHelper.cs" />
     <Compile Include="DTO\Helper\PwgCategoryWPFHelper.cs" />
     <Compile Include="DTO\Helper\PwgCategoryListWPFHelper.cs" />
@@ -84,8 +88,11 @@
     <Compile Include="DTO\PwgModelManager.cs" />
     <Compile Include="Helper\AppHelper.cs" />
+    <Compile Include="Helper\ImageUrlCachedConverter.cs" />
+    <Compile Include="Service\ImageCacheManager.cs" />
     <Compile Include="Settings.cs" />
     <Page Include="MainWindow.xaml">
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
+      <CustomToolNamespace>Com.Pixigo.Wpf</CustomToolNamespace>
     </Page>
     <Compile Include="App.xaml.cs">
@@ -104,4 +111,8 @@
       <SubType>Code</SubType>
     </Compile>
+    <Page Include="VisualStyleApp.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
   </ItemGroup>
   <ItemGroup>
@@ -122,5 +133,4 @@
       <Generator>ResXFileCodeGenerator</Generator>
       <LastGenOutput>Resources.Designer.cs</LastGenOutput>
-      <SubType>Designer</SubType>
     </EmbeddedResource>
     <None Include="app.config" />
@@ -132,5 +142,5 @@
   </ItemGroup>
   <ItemGroup>
-    <EmbeddedResource Include="Pictures\PiwigoLogo.png" />
+    <Resource Include="Pictures\PiwigoLogo.png" />
   </ItemGroup>
   <ItemGroup>
@@ -165,4 +175,10 @@
     </BootstrapperPackage>
   </ItemGroup>
+  <ItemGroup>
+    <Resource Include="Pictures\Globe.png" />
+  </ItemGroup>
+  <ItemGroup>
+    <Resource Include="Pictures\folder_images.png" />
+  </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
Index: /extensions/PiwigoLib/PiwigoWpf/PiwigoWpf.csproj.user
===================================================================
--- /extensions/PiwigoLib/PiwigoWpf/PiwigoWpf.csproj.user	(revision 11904)
+++ /extensions/PiwigoLib/PiwigoWpf/PiwigoWpf.csproj.user	(revision 11904)
@@ -0,0 +1,13 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <PublishUrlHistory>publish\</PublishUrlHistory>
+    <InstallUrlHistory />
+    <SupportUrlHistory />
+    <UpdateUrlHistory />
+    <BootstrapperUrlHistory />
+    <ErrorReportUrlHistory />
+    <FallbackCulture>fr-FR</FallbackCulture>
+    <VerifyUploadedFiles>false</VerifyUploadedFiles>
+  </PropertyGroup>
+</Project>
Index: /extensions/PiwigoLib/PiwigoWpf/Properties/Settings.Designer.cs
===================================================================
--- /extensions/PiwigoLib/PiwigoWpf/Properties/Settings.Designer.cs	(revision 11903)
+++ /extensions/PiwigoLib/PiwigoWpf/Properties/Settings.Designer.cs	(revision 11904)
@@ -9,4 +9,5 @@
 //------------------------------------------------------------------------------
 
+using System;
 namespace Com.Piwigo.Wpf.Properties {
     
Index: /extensions/PiwigoLib/PiwigoWpf/Service/ImageCacheManager.cs
===================================================================
--- /extensions/PiwigoLib/PiwigoWpf/Service/ImageCacheManager.cs	(revision 11904)
+++ /extensions/PiwigoLib/PiwigoWpf/Service/ImageCacheManager.cs	(revision 11904)
@@ -0,0 +1,135 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Com.Piwigo.Wpf.DTO;
+using System.Threading;
+using System.IO;
+using System.Net;
+using System.Drawing;
+using Com.Piwigo.Wpf.Helper;
+
+namespace Com.Piwigo.Wpf.Service
+{
+    public class ImageCacheManager
+    {
+        static readonly ImageCacheManagerBase _instance = new ImageCacheManagerBase();
+
+        static readonly ImageUrlCachedConverter _imageUrlCachedConverter = new ImageUrlCachedConverter();
+
+        // Explicit static constructor to tell C# compiler
+        // not to mark type as beforefieldinit
+        static ImageCacheManager()
+        {
+        }
+
+        public static ImageCacheManagerBase Instance
+        {
+            get
+            {
+                return _instance;
+            }
+        }
+
+        public static ImageUrlCachedConverter ImageUrlCachedConverter
+        {
+            get
+            {
+                return _imageUrlCachedConverter;
+            }
+        }
+        public class ImageCacheManagerBase
+        {
+            // local DTO
+            private class ImageDictionnary : SortedDictionary<Int32, String> { };
+            private class ServerDictionnary : SortedDictionary<String, ImageDictionnary> { };
+
+            private Object _lock = new Object(); 
+            
+            // local helper
+            static private String BuildServerDirCache(String serveurUri)
+            {
+                String AppCachedDataDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),"cache");
+                String ServerDirCache = Path.Combine(AppCachedDataDirectory, serveurUri.Replace("http://", "_").Replace("/", "_")); 
+
+                return ServerDirCache;
+            }
+            
+           
+
+            private ServerDictionnary _aServerDictionnary = new ServerDictionnary();
+            private String _currentServer;
+            private ImageDictionnary _currentImageDictionnary = new ImageDictionnary();
+
+            public void SetCurrentServer(String serveurUri)
+            {
+                String currentserverDir = BuildServerDirCache(serveurUri);
+                lock (_lock)
+                {
+                    if (_aServerDictionnary.ContainsKey(serveurUri))
+                    {
+                        _currentServer = serveurUri;
+                    }
+                    else
+                    {
+                        ImageDictionnary newImageDictionnary = new ImageDictionnary();
+                        _aServerDictionnary.Add(serveurUri, newImageDictionnary);
+                        _currentServer = serveurUri;
+                    }
+                }
+                if (!Directory.Exists(currentserverDir))
+                {
+                    //Create it
+                    Directory.CreateDirectory(currentserverDir);
+                }
+            }
+
+            public String GetImageFilename(PwgImageWPF aImageWPF)
+                {
+                    if (aImageWPF == null)
+                    {
+                        return String.Empty;
+                    }
+
+                    String retValue;
+                    String currentserverDir = BuildServerDirCache(_currentServer); 
+                    String localFile = Path.Combine(currentserverDir, String.Format("{0}-{1}", aImageWPF.Id, aImageWPF.File)); 
+
+                    if (_aServerDictionnary[_currentServer].ContainsKey(aImageWPF.Id))
+                    {
+                        retValue = _aServerDictionnary[_currentServer][aImageWPF.Id];
+                    }
+                    else
+                    {
+                        if (!File.Exists(localFile))
+                        {
+                           ThreadPool.QueueUserWorkItem((WaitCallback)delegate
+                        {
+                            WebRequest request = HttpWebRequest.Create(aImageWPF.UrlElement);
+                            WebResponse response = request.GetResponse();
+
+                            //check the content type to assert that the file in the uri is an image
+                           if (!response.ContentType.StartsWith("image"))
+                           {
+                              throw new FileFormatException(aImageWPF.UrlElement, String.Format("Uri passed to ImageCacher does not return an image. Content is of type {0}.", response.ContentType));
+                           }
+
+                           //load the image from the stream
+                           Image image = Image.FromStream(response.GetResponseStream());
+  
+                           //save it
+                           image.Save(localFile); 
+
+                        });
+
+                        }
+                        
+                        _aServerDictionnary[_currentServer].Add(aImageWPF.Id,localFile);
+                        retValue = localFile; 
+                    }
+                    return retValue;
+                }
+        }
+    }
+
+}
Index: /extensions/PiwigoLib/PiwigoWpf/VisualStyleApp.xaml
===================================================================
--- /extensions/PiwigoLib/PiwigoWpf/VisualStyleApp.xaml	(revision 11904)
+++ /extensions/PiwigoLib/PiwigoWpf/VisualStyleApp.xaml	(revision 11904)
@@ -0,0 +1,311 @@
+﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+                    >
+    <LinearGradientBrush x:Key="WindowGradient" StartPoint="0,0.3" EndPoint="1,0">
+        <LinearGradientBrush.GradientStops>
+            <GradientStop Color="#B2B6CAFF" Offset="0" />
+            <GradientStop Color="#BFC3D5FF" Offset="0.1" />
+            <GradientStop Color="#E0E4F0FF" Offset="0.3" />
+            <GradientStop Color="#E6EAF5FF" Offset="0.5" />
+            <GradientStop Color="#CFD7E2FF" Offset="0.6" />
+            <GradientStop Color="#BFC5D3FF" Offset="0.8" />
+            <GradientStop Color="#C4CBD8FF" Offset="1" />
+        </LinearGradientBrush.GradientStops>
+    </LinearGradientBrush>
+
+    <LinearGradientBrush x:Key="ListBoxGradient" StartPoint="0,0" EndPoint="0,1">
+        <LinearGradientBrush.GradientStops>
+            <GradientStop Color="#90000000" Offset="0" />
+            <GradientStop Color="#40000000" Offset="0.005" />
+            <GradientStop Color="#10000000" Offset="0.04" />
+            <GradientStop Color="#20000000" Offset="0.945" />
+            <GradientStop Color="#60FFFFFF" Offset="1" />
+        </LinearGradientBrush.GradientStops>
+    </LinearGradientBrush>
+
+    <LinearGradientBrush x:Key="ReflectionGradient" StartPoint="0,1" EndPoint="0,0">
+        <LinearGradientBrush.GradientStops>
+            <GradientStop Color="#50000000" Offset="0" />
+            <GradientStop Color="Transparent" Offset=".5" />
+        </LinearGradientBrush.GradientStops>
+    </LinearGradientBrush>
+
+    <LinearGradientBrush x:Key="ButtonGradient" StartPoint="0,0" EndPoint="0,1">
+        <LinearGradientBrush.GradientStops>
+            <GradientStop Color="#FDB6CADF" Offset="0" />
+            <GradientStop Color="#FCC3C5FF" Offset="0.1" />
+            <GradientStop Color="#FCC4D0EF" Offset="0.3" />
+            <GradientStop Color="#FDB7C2DF" Offset="0.6" />
+            <GradientStop Color="#FE95B3CF" Offset="0.8" />
+            <GradientStop Color="#FE96AACF" Offset="1" />
+        </LinearGradientBrush.GradientStops>
+    </LinearGradientBrush>
+
+    <LinearGradientBrush x:Key="VerticalScrollGradient" StartPoint="0,0" EndPoint="1,0">
+        <LinearGradientBrush.GradientStops>
+            <GradientStop Color="#FDB6CADF" Offset="0" />
+            <GradientStop Color="#FCC3C5FF" Offset="0.1" />
+            <GradientStop Color="#FCC4D0EF" Offset="0.3" />
+            <GradientStop Color="#FDB7C2DF" Offset="0.6" />
+            <GradientStop Color="#FE95B3CF" Offset="0.8" />
+            <GradientStop Color="#FE96AACF" Offset="1" />
+        </LinearGradientBrush.GradientStops>
+    </LinearGradientBrush>
+
+    <LinearGradientBrush x:Key="ComboBoxGradient" StartPoint="0,0" EndPoint="0,1">
+        <LinearGradientBrush.GradientStops>
+            <GradientStop Color="#B2B6CAFF" Offset="0" />
+            <GradientStop Color="#B0B3C5FF" Offset="0.1" />
+            <GradientStop Color="#BEE4E0FF" Offset="0.3" />
+            <GradientStop Color="#B0D7E2FF" Offset="0.6" />
+            <GradientStop Color="#B0C5D3FF" Offset="0.8" />
+            <GradientStop Color="#C4CBD8FF" Offset="1" />
+        </LinearGradientBrush.GradientStops>
+    </LinearGradientBrush>
+
+    <LinearGradientBrush x:Key="GreetingCardGradient" StartPoint="0,0" EndPoint="0,1">
+        <LinearGradientBrush.GradientStops>
+            <GradientStop Color="#EEEEEE" Offset="0" />
+            <GradientStop Color="#FFFFFF" Offset="1" />
+        </LinearGradientBrush.GradientStops>
+    </LinearGradientBrush>
+
+    <LinearGradientBrush x:Key="ButtonUpGradient" StartPoint="0,0" EndPoint="0,1">
+        <LinearGradientBrush.GradientStops>
+            <GradientStop Color="Transparent" Offset="0" />
+            <GradientStop Color="#33000000" Offset="1" />
+        </LinearGradientBrush.GradientStops>
+    </LinearGradientBrush>
+
+    <LinearGradientBrush x:Key="ButtonDownGradient" StartPoint="0,0" EndPoint="0,1">
+        <LinearGradientBrush.GradientStops>
+            <GradientStop Color="#10000000" Offset="0" />
+            <GradientStop Color="#20000000" Offset="1" />
+        </LinearGradientBrush.GradientStops>
+    </LinearGradientBrush>
+
+    <LinearGradientBrush x:Key="ButtonDisabledGradient" StartPoint="0,0" EndPoint="0,1">
+        <LinearGradientBrush.GradientStops>
+            <GradientStop Color="#10302A90" Offset="0" />
+            <GradientStop Color="#10201040" Offset="1" />
+        </LinearGradientBrush.GradientStops>
+    </LinearGradientBrush>
+
+    <!-- STYLES -->
+
+    <Style x:Key="TitleText" TargetType="{x:Type TextBlock}" >
+        <Setter Property="FontFamily" Value="Segoe Black" />
+        <Setter Property="FontSize" Value="20px" />
+        <Setter Property="Foreground" Value="MidnightBlue" />
+    </Style>
+
+    <!-- BUTTON TEMPLATE -->
+    <Style TargetType="{x:Type Button}">
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type Button}">
+                    <Border x:Name="OuterBorder"
+							CornerRadius="3" 
+							Background="{DynamicResource ButtonGradient}">
+                        <Border
+								x:Name="InnerBorder"
+								CornerRadius="3"
+								Background="{DynamicResource ButtonUpGradient}"
+								Padding="{TemplateBinding Padding}">
+                            <ContentPresenter x:Name="ContentSite" 
+								HorizontalAlignment="Center" 
+								VerticalAlignment="Center" />
+                        </Border>
+                    </Border>
+                    <ControlTemplate.Triggers>
+                        <Trigger Property="IsPressed" Value="true">
+                            <Setter TargetName="InnerBorder" Property="Background" Value="{DynamicResource ButtonDownGradient}" />
+                        </Trigger>
+                        <Trigger Property="IsEnabled" Value="false">
+                            <Setter TargetName="InnerBorder" Property="Background" Value="{DynamicResource ButtonDisabledGradient}"  />
+                            <Setter Property="BorderBrush" Value="Silver"  />
+                            <Setter Property="Foreground" Value="SlateGray"  />
+                        </Trigger>
+                    </ControlTemplate.Triggers>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+        <Setter Property="Height" Value="18" />
+        <Setter Property="Foreground" Value="MidnightBlue" />
+    </Style>
+
+    <!-- COMBOBOX STYLE -->
+
+    <Style TargetType="{x:Type ComboBox}" >
+        <Setter Property="Background" Value="{DynamicResource ComboBoxGradient}" />
+        <Setter Property="BorderThickness" Value="0" />
+        <Setter Property="Height" Value="18px" />
+        <Setter Property="Foreground" Value="MidnightBlue" />
+    </Style>
+
+    <!-- PROGRESS BAR STYLE -->
+
+    <Style TargetType="{x:Type ProgressBar}" >
+        <Setter Property="Background" Value="{DynamicResource ComboBoxGradient}" />
+        <Setter Property="BorderThickness" Value="1" />
+        <Setter Property="BorderBrush" Value="Gray" />
+        <Setter Property="Foreground" Value="MidnightBlue" />
+    </Style>
+
+    <!-- SCROLLBAR TEMPLATES -->
+
+    <Style x:Key="Scrollbar_LineButton" TargetType="{x:Type RepeatButton}">
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type RepeatButton}">
+                    <Border 
+							BorderBrush="Transparent" 
+							BorderThickness="1" 
+							CornerRadius="6" 
+							Background="{DynamicResource ButtonGradient}">
+                        <ContentPresenter x:Name="ContentSite" />
+                    </Border>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+        <Setter Property="MinHeight" Value="12" />
+        <Setter Property="MinWidth" Value="12" />
+        <Setter Property="Foreground" Value="Gray" />
+        <Setter Property="FontSize" Value="6pt" />
+        <Setter Property="FontWeight" Value="Bold" />
+        <Setter Property="FontFamily" Value="Lucida Sans" />
+        <Setter Property="VerticalAlignment" Value="Center" />
+        <Setter Property="HorizontalAlignment" Value="Center" />
+    </Style>
+
+    <Style x:Key="ScrollBar_TrackRepeater"  TargetType="{x:Type RepeatButton}">
+        <Setter Property="IsTabStop" Value="false" />
+        <Setter Property="Focusable" Value="false" />
+        <Setter Property="Command" Value="ScrollBar.PageUpCommand" />
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type RepeatButton}">
+                    <Rectangle Fill="Transparent" />
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+    </Style>
+
+    <Style x:Key="ScrollBar_UpTrack" BasedOn="{StaticResource ScrollBar_TrackRepeater}" TargetType="{x:Type RepeatButton}">
+        <Setter Property="Command" Value="ScrollBar.PageUpCommand" />
+    </Style>
+
+    <Style x:Key="ScrollBar_DownTrack" BasedOn="{StaticResource ScrollBar_TrackRepeater}" TargetType="{x:Type RepeatButton}">
+        <Setter Property="Command" Value="ScrollBar.PageDownCommand" />
+    </Style>
+
+    <Style x:Key="ScrollBar_LeftTrack" BasedOn="{StaticResource ScrollBar_TrackRepeater}" TargetType="{x:Type RepeatButton}">
+        <Setter Property="Command" Value="ScrollBar.PageLeftCommand" />
+    </Style>
+
+    <Style x:Key="ScrollBar_RightTrack" BasedOn="{StaticResource ScrollBar_TrackRepeater}" TargetType="{x:Type RepeatButton}">
+        <Setter Property="Command" Value="ScrollBar.PageRightCommand" />
+    </Style>
+
+    <Style x:Key="ScrollBar_VerticalThumb" TargetType="{x:Type Thumb}">
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type Thumb}">
+                    <Border CornerRadius="6" 
+							BorderBrush="Transparent"     
+							BorderThickness="1" 
+							Background="{DynamicResource VerticalScrollGradient}" />
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+        <Setter Property="MinHeight" Value="10" />
+        <Setter Property="MinWidth" Value="10" />
+    </Style>
+
+    <Style x:Key="ScrollBar_HorizontalThumb" TargetType="{x:Type Thumb}">
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type Thumb}">
+                    <Border CornerRadius="6" 
+							BorderBrush="Transparent"     
+							BorderThickness="1" 
+							Background="{DynamicResource ButtonGradient}" />
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+        <Setter Property="MinHeight" Value="10" />
+        <Setter Property="MinWidth" Value="10" />
+    </Style>
+
+    <Style TargetType="{x:Type ScrollBar}">
+        <Setter Property="Background" Value="Transparent" />
+        <Setter Property="MinWidth" Value="10" />
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type ScrollBar}">
+                    <Grid>
+                        <Grid.ColumnDefinitions>
+                            <ColumnDefinition Width="10"/>
+                        </Grid.ColumnDefinitions>
+                        <Grid.RowDefinitions>
+                            <RowDefinition Height="10" />
+                            <RowDefinition Height="*"/>
+                            <RowDefinition Height="10" />
+                        </Grid.RowDefinitions>
+                        <Border Grid.Row="1" BorderThickness="0" Background="Transparent" CornerRadius="4"/>
+                        <RepeatButton Grid.Row="0" Style="{DynamicResource Scrollbar_LineButton}" Command="ScrollBar.LineUpCommand" Content=" ^" />
+                        <Track Grid.Row="1" Name="PART_Track"  IsDirectionReversed="True">
+                            <Track.IncreaseRepeatButton>
+                                <RepeatButton Style="{DynamicResource ScrollBar_DownTrack}"/>
+                            </Track.IncreaseRepeatButton>
+                            <Track.DecreaseRepeatButton>
+                                <RepeatButton Style="{DynamicResource ScrollBar_UpTrack}"/>
+                            </Track.DecreaseRepeatButton>
+                            <Track.Thumb>
+                                <Thumb Style="{DynamicResource ScrollBar_VerticalThumb}"/>
+                            </Track.Thumb>
+                        </Track>
+                        <RepeatButton Grid.Row="2" Style="{DynamicResource Scrollbar_LineButton}" Command="ScrollBar.LineDownCommand" Content=" v" />
+                    </Grid>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+        <Style.Triggers>
+            <Trigger Property="Orientation" Value="Horizontal" >
+                <Setter Property="Background" Value="Transparent" />
+                <Setter Property="MinHeight" Value="10" />
+                <Setter Property="Template">
+                    <Setter.Value>
+                        <ControlTemplate TargetType="{x:Type ScrollBar}">
+                            <Grid>
+                                <Grid.RowDefinitions>
+                                    <RowDefinition Height="12"/>
+                                </Grid.RowDefinitions>
+                                <Grid.ColumnDefinitions>
+                                    <ColumnDefinition Width="12" />
+                                    <ColumnDefinition Width="*"/>
+                                    <ColumnDefinition Width="12" />
+                                </Grid.ColumnDefinitions>
+                                <Border Grid.Column="1" BorderThickness="0" Background="Transparent" CornerRadius="4"/>
+                                <RepeatButton Grid.Column="0" Style="{DynamicResource Scrollbar_LineButton}" Command="ScrollBar.LineLeftCommand" Content=" &lt;" />
+                                <Track Grid.Column="1" Name="PART_Track">
+                                    <Track.IncreaseRepeatButton>
+                                        <RepeatButton Style="{DynamicResource ScrollBar_RightTrack}"/>
+                                    </Track.IncreaseRepeatButton>
+                                    <Track.DecreaseRepeatButton>
+                                        <RepeatButton Style="{DynamicResource ScrollBar_LeftTrack}"/>
+                                    </Track.DecreaseRepeatButton>
+                                    <Track.Thumb>
+                                        <Thumb Style="{DynamicResource ScrollBar_HorizontalThumb}"/>
+                                    </Track.Thumb>
+                                </Track>
+                                <RepeatButton Grid.Column="2" Style="{DynamicResource Scrollbar_LineButton}" Command="ScrollBar.LineRightCommand" Content=" &gt;" />
+
+                            </Grid>
+                        </ControlTemplate>
+                    </Setter.Value>
+                </Setter>
+            </Trigger>
+        </Style.Triggers>
+    </Style>
+</ResourceDictionary>
Index: /extensions/PiwigoLib/TestPiwigoLib/Form1.cs
===================================================================
--- /extensions/PiwigoLib/TestPiwigoLib/Form1.cs	(revision 11903)
+++ /extensions/PiwigoLib/TestPiwigoLib/Form1.cs	(revision 11904)
@@ -60,5 +60,7 @@
                 //Console.WriteLine("lstImg : Page " + Page.ToString() + " PerPage " + PerPage);
 
-                //List<PwgCategory> lstCat = PwgServiceProvider.Instance.PwgCategoriesService.GetAdminListOfCategory(); 
+                List<PwgCategory> lstadmCat = PwgServiceProvider.Instance.PwgCategoriesService.GetAdminListOfCategory(); 
+
+                List<PwgCategory> lstCat = PwgServiceProvider.Instance.PwgCategoriesService.GetListOfCategory(0, true, false);
 
                 Int32 newid = 0;
@@ -74,7 +76,7 @@
                 //lstCat = PwgServiceProvider.Instance.PwgCategoriesService.GetAdminListOfCategory(); 
 
-                FileInfo fiBig = new FileInfo("C:\\Users\\bayral\\Downloads\\49133_1636405570_2648232_n.jpg");
-                FileInfo fiThumb = new FileInfo(MakeThumb(fiBig, "C:\\Users\\bayral\\Downloads\\49133_1636405570_2648232_n_thum.jpg", 64));
-                FileInfo fiLow = new FileInfo(MakeThumb(fiBig, "C:\\Users\\bayral\\Downloads\\49133_1636405570_2648232_n_low.jpg", 256));
+                //FileInfo fiBig = new FileInfo("C:\\Users\\bayral\\Downloads\\49133_1636405570_2648232_n.jpg");
+                //FileInfo fiThumb = new FileInfo(MakeThumb(fiBig, "C:\\Users\\bayral\\Downloads\\49133_1636405570_2648232_n_thum.jpg", 64));
+                //FileInfo fiLow = new FileInfo(MakeThumb(fiBig, "C:\\Users\\bayral\\Downloads\\49133_1636405570_2648232_n_low.jpg", 256));
 
                 //FileInfo fiBig = new FileInfo("C:\\temp\\Oryx.jpg");
@@ -83,5 +85,5 @@
 
                 //PwgImageAdded imgAdd = PwgServiceProvider.Instance.PwgImagesService.addImageByMultiPartForm(fiBig, null, 1, "benoit", "byarl", "test upload", 0, new List<PwgTag>() { new PwgTag() { Name = "Benoit" }, new PwgTag() { Name = "Noé" } });
-                rc = PwgServiceProvider.Instance.PwgImagesService.addImage(fiBig, fiLow, fiThumb, "Benoit", "bayral", DateTime.Now, "demo", new List<string>() { "1" }, new List<string>() { "Benoit" }, PwgConfidentLevelEnum.All);
+                //rc = PwgServiceProvider.Instance.PwgImagesService.addImage(fiBig, fiLow, fiThumb, "Benoit", "bayral", DateTime.Now, "demo", new List<string>() { "1" }, new List<string>() { "Benoit" }, PwgConfidentLevelEnum.All);
                 //rc = PwgServiceProvider.Instance.PwgImagesService.DeleteImage(319, sess.SecurityToken);
 
