mirror of https://github.com/icsharpcode/ILSpy.git
3 changed files with 47 additions and 7 deletions
@ -0,0 +1,28 @@
@@ -0,0 +1,28 @@
|
||||
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); |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue