diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/ImageSourceEditor/ChooseImageDialog.xaml b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/ImageSourceEditor/ChooseImageDialog.xaml
new file mode 100644
index 0000000000..c15390f9d6
--- /dev/null
+++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/ImageSourceEditor/ChooseImageDialog.xaml
@@ -0,0 +1,164 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/ImageSourceEditor/ChooseImageDialog.xaml.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/ImageSourceEditor/ChooseImageDialog.xaml.cs
new file mode 100644
index 0000000000..719d5a110d
--- /dev/null
+++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/ImageSourceEditor/ChooseImageDialog.xaml.cs
@@ -0,0 +1,186 @@
+//
+//
+//
+//
+// $Revision: $
+//
+using System;
+using System.Diagnostics;
+using System.IO;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using Microsoft.Win32;
+
+using ICSharpCode.WpfDesign.PropertyGrid;
+
+namespace ICSharpCode.WpfDesign.AddIn.ImageSourceEditor
+{
+ ///
+ /// Dialog which allows user to add images to the project
+ ///
+ public partial class ChooseImageDialog : Window
+ {
+ ///
+ /// Inner ListBox which displays the images
+ ///
+ private ListBox _imgDisplay;
+
+ ///
+ /// Contains the allowed extensions for image files.
+ ///
+ private static string[] Extension;
+
+ private PropertyNode _node;
+ private List _data;
+
+ static ChooseImageDialog()
+ {
+ Extension = new String[]{".jpg", ".bmp", ".png", ".gif", ".ico", ".dib", ".jpe", ".jpeg", ".tif", ".tiff"};
+ }
+
+ public ChooseImageDialog(PropertyNode node)
+ {
+ this._node=node;
+ this._data=new List();
+ InitializeComponent();
+ }
+
+ protected override void OnInitialized(EventArgs e)
+ {
+ base.OnInitialized(e);
+ List> images=new List>();
+
+ /* Get image file with allowed extensions and group them with their directory */
+ images=ProjectTools.RetrieveFiles(ChooseImageDialog.Extension);
+ IEnumerable> grouping = images.GroupBy(image => image.Key, image => image.Value);
+
+ /* Set values for _data and bind to the ListBox */
+ foreach(IGrouping group in grouping){
+ List temp=new List();
+ foreach(var name in group){
+ temp.Add(name);
+ }
+ _data.Add(new ImageData(group.Key + Path.DirectorySeparatorChar,temp));
+ }
+
+ Display.ItemsSource=_data;
+ }
+
+ #region Event Handlers
+ private void AddClick(object sender, RoutedEventArgs e)
+ {
+ OpenFileDialog dialog=new OpenFileDialog();
+ dialog.Filter="Image Files | *" + String.Join(";*",Extension);
+ dialog.Multiselect=true;
+ dialog.CheckFileExists=true;
+ dialog.Title="Choose Image";
+
+ if(dialog.ShowDialog() == true){
+ string []fileNames=dialog.FileNames;
+ ProjectTools.AddFiles(fileNames);
+
+ /* Add files to _data so that the ListBox is updated. Note that as Images are added to the project directory,
+ * images will be added in the _data with ImageData having header Path.DirectorySeparatorChar. */
+ List temp=new List();
+ foreach(var file in fileNames){
+ temp.Add(Path.GetFileName(file));
+ }
+ _data.OrderBy(image => image.Header).ElementAt(0).Images.AddRange(fileNames);
+ }
+ }
+
+ private void imgDisplayLoaded(object sender, RoutedEventArgs e)
+ {
+ _imgDisplay=new ListBox();
+ _imgDisplay=sender as ListBox;
+ _imgDisplay.MouseDoubleClick+=ImageDisplayDoubleClick;
+ }
+
+ private void imgDisplaySelectionChanged(object sender, RoutedEventArgs e)
+ {
+ _imgDisplay=sender as ListBox;
+ if(_imgDisplay.SelectedItem!=null)
+ txURL.Text=(string)_imgDisplay.SelectedItem;
+ }
+
+ private void OkClick(object sender, RoutedEventArgs e)
+ {
+ Save();
+ }
+
+ private void ImageDisplayDoubleClick(object sender, RoutedEventArgs e)
+ {
+ if(_imgDisplay.SelectedItem!=null){
+ _node.Value=_imgDisplay.SelectedItem;
+ Close();
+ }
+
+ }
+
+ protected override void OnPreviewKeyUp(KeyEventArgs e)
+ {
+ base.OnPreviewKeyUp(e);
+ if(e.Key==Key.Enter)
+ Save();
+ }
+
+ private void Save()
+ {
+ Debug.Assert(_imgDisplay!=null);
+ if(_imgDisplay.SelectedItem!=null){
+ _node.Value=_imgDisplay.SelectedItem;
+ Close();
+ }else{
+ if(File.Exists(txURL.Text) && uxOk.IsFocused){
+ if(Extension.Contains(Path.GetExtension(txURL.Text)))
+ _node.Value=Path.GetFullPath(txURL.Text);
+ else
+ MessageBox.Show(this, "The specified file is not a valid image file", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
+
+ Close();
+ }
+ else{
+ MessageBox.Show(this, "The specified file does not exist on the disk", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
+ }
+ }
+ }
+
+ private void Cancel(object sender, RoutedEventArgs e)
+ {
+ Close();
+ }
+
+ void DisplaySelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ Display.SelectedItem=null;
+ }
+
+ #endregion
+ }
+
+ public class ImageData
+ {
+ ///
+ /// Stores the directory where are there.
+ ///
+ public string Header { get; set; }
+
+ ///
+ /// Contains the name of all images in .
+ ///
+ public List Images { get; set; }
+
+ public ImageData(string header,List images)
+ {
+ this.Header=header;
+ this.Images=images;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/ImageSourceEditor/ImageSourceEditor.xaml b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/ImageSourceEditor/ImageSourceEditor.xaml
new file mode 100644
index 0000000000..7e78e6468d
--- /dev/null
+++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/ImageSourceEditor/ImageSourceEditor.xaml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/ImageSourceEditor/ImageSourceEditor.xaml.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/ImageSourceEditor/ImageSourceEditor.xaml.cs
new file mode 100644
index 0000000000..fb6f4f71d0
--- /dev/null
+++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/ImageSourceEditor/ImageSourceEditor.xaml.cs
@@ -0,0 +1,46 @@
+//
+//
+//
+//
+// $Revision: $
+//
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+
+using ICSharpCode.WpfDesign.PropertyGrid;
+
+namespace ICSharpCode.WpfDesign.AddIn.ImageSourceEditor
+{
+ ///
+ /// Editor to edit properties of type of ImageSource such as Windows.Icon or Image.Source
+ ///
+ [TypeEditor(typeof (ImageSource))]
+ public partial class ImageSourceEditor
+ {
+ public ImageSourceEditor()
+ {
+ InitializeComponent();
+ }
+
+ private void ChooseImageClick(object sender, RoutedEventArgs e)
+ {
+ ChooseImageDialog cid = new ChooseImageDialog(PropertyNode);
+ cid.ShowActivated = true;
+ cid.Show();
+ }
+
+ ///
+ /// Gets the property node that the editor is editing.
+ ///
+ public PropertyNode PropertyNode{
+ get { return DataContext as PropertyNode; }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/ProjectTools.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/ProjectTools.cs
new file mode 100644
index 0000000000..c934a23d8a
--- /dev/null
+++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/ProjectTools.cs
@@ -0,0 +1,68 @@
+//
+//
+//
+//
+// $Revision: $
+//
+using System;
+using System.IO;
+using System.Diagnostics;
+using System.Collections.Generic;
+using System.Linq;
+using ICSharpCode.SharpDevelop.Project;
+using ICSharpCode.Core;
+
+namespace ICSharpCode.WpfDesign.AddIn
+{
+ ///
+ /// Static helper methods to interact with the project
+ ///
+ public class ProjectTools
+ {
+ ///
+ /// Add files to the current project at the project node.
+ ///
+ ///
+ internal static void AddFiles(string []fileNames)
+ {
+ IProject project=ProjectService.CurrentProject;
+ ProjectNode projectNode=ProjectBrowserPad.Instance.CurrentProject;
+ Debug.Assert(project!=null);
+ Debug.Assert(projectNode!=null);
+
+ foreach(var file in fileNames){
+ string relFileName=FileUtility.GetRelativePath(project.Directory,file);
+ FileProjectItem fileProjectItem=new FileProjectItem(project,project.GetDefaultItemType(file),relFileName);
+ FileNode fileNode=new FileNode(file,FileNodeStatus.InProject);
+ fileNode.ProjectItem=fileProjectItem;
+ fileNode.InsertSorted(projectNode);
+ ProjectService.AddProjectItem(project,fileProjectItem);
+ }
+ project.Save();
+ }
+
+ ///
+ /// Get all files with given in the project and returns directory and the filename
+ ///
+ ///
+ ///
+ internal static List> RetrieveFiles(string []Extension)
+ {
+ List> files=new List>();
+ IProject project=ProjectService.CurrentProject;
+ Debug.Assert(project!=null);
+
+ foreach(var item in project.Items){
+ FileProjectItem fileProjectItem=item as FileProjectItem;
+ if(fileProjectItem!=null){
+ string dirName=Path.GetDirectoryName(fileProjectItem.VirtualName);
+ if(Extension.Contains(Path.GetExtension(fileProjectItem.VirtualName)))
+ files.Add(new KeyValuePair(dirName, fileProjectItem.FileName));
+ }
+ }
+
+ return files;
+ }
+
+ }
+}
diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/WpfDesign.AddIn.csproj b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/WpfDesign.AddIn.csproj
index 7bb4adf180..b9f8349eb9 100644
--- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/WpfDesign.AddIn.csproj
+++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/WpfDesign.AddIn.csproj
@@ -63,11 +63,20 @@
+
+ ChooseImageDialog.xaml
+ Code
+
+
+ ImageSourceEditor.xaml
+ Code
+
ObjectEditor.xaml
+
@@ -131,6 +140,11 @@
WpfDesign
False
+
+
+
+
+
\ No newline at end of file