mirror of https://github.com/icsharpcode/ILSpy.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
670 B
28 lines
670 B
using System; |
|
using System.Collections.Generic; |
|
using System.Linq; |
|
using System.Text; |
|
using System.Threading.Tasks; |
|
using System.Windows; |
|
using System.Windows.Controls; |
|
using System.Windows.Media; |
|
|
|
namespace ICSharpCode.TreeView |
|
{ |
|
class IconDataTemplateSelector : DataTemplateSelector |
|
{ |
|
public DataTemplate ImageDataTemplate { get; set; } |
|
|
|
public DataTemplate VectorDataTemplate { get; set; } |
|
|
|
public override DataTemplate SelectTemplate(object item, DependencyObject container) |
|
{ |
|
if (item is ImageSource) |
|
return ImageDataTemplate; |
|
if (item is DrawingGroup) |
|
return VectorDataTemplate; |
|
|
|
return base.SelectTemplate(item, container); |
|
} |
|
} |
|
}
|
|
|