Browse Source

Added graphics support. Fixed description for every new file item.

pull/517/head^2
Ciprian Khlud 11 years ago
parent
commit
6b7915a088
  1. 14
      src/Main/Base/Project/Src/Gui/Dialogs/NewFileTemplateItem.cs
  2. 1
      src/Main/Base/Project/Src/Gui/Dialogs/NewFileViewModel.cs
  3. 3
      src/Main/Base/Project/Src/Gui/Dialogs/NewFileWindow.xaml

14
src/Main/Base/Project/Src/Gui/Dialogs/NewFileTemplateItem.cs

@ -1,4 +1,7 @@ @@ -1,4 +1,7 @@
using ICSharpCode.SharpDevelop.Templates;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Templates;
using ICSharpCode.SharpDevelop.Widgets;
namespace ICSharpCode.SharpDevelop.Gui
@ -12,7 +15,14 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -12,7 +15,14 @@ namespace ICSharpCode.SharpDevelop.Gui
public FileTemplate Template { get; private set; }
public string DisplayName { get { return Template.DisplayName; } }
public string Description { get { return Template.Description; } }
public string Description { get {
return StringParser.Parse(Template.Description);
} }
public ImageSource Picture { get{
return Template.Icon.ImageSource;
}
}
public string Name { get { return Template.Name; } }
}
}

1
src/Main/Base/Project/Src/Gui/Dialogs/NewFileViewModel.cs

@ -9,6 +9,7 @@ @@ -9,6 +9,7 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Runtime.CompilerServices;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Templates;

3
src/Main/Base/Project/Src/Gui/Dialogs/NewFileWindow.xaml

@ -57,10 +57,13 @@ @@ -57,10 +57,13 @@
>
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<Image Source="{Binding Picture}" Width="32" />
<StackPanel>
<Label Content="{Binding DisplayName}" FontWeight="Bold" />
<Label Content="{Binding Description}" />
</StackPanel>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>

Loading…
Cancel
Save