Expand folder icon example

This commit is contained in:
Unknown
2018-01-26 22:16:45 +00:00
parent e6736afa2c
commit 036f2cb722
3 changed files with 4 additions and 15 deletions

View File

@ -16,20 +16,7 @@ namespace WpfTreeView
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
// By default, we presume an image
var image = "Images/file.png";
switch ((DirectoryItemType)value)
{
case DirectoryItemType.Drive:
image = "Images/drive.png";
break;
case DirectoryItemType.Folder:
image = "Images/folder-closed.png";
break;
}
return new BitmapImage(new Uri($"pack://application:,,,/{image}"));
return new BitmapImage(new Uri($"pack://application:,,,/Images/{value}.png"));
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)