1234567891011121314151617181920212223242526272829303132333435 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows;
- using System.Windows.Controls;
- namespace VirgoUI.Client.Models.Recipe
- {
- public class FolderOrFileTemplateSelector : DataTemplateSelector
- {
- public DataTemplate FolderTemplate
- {
- get;
- set;
- }
- public DataTemplate FileTemplate
- {
- get;
- set;
- }
- public override DataTemplate SelectTemplate(object item, DependencyObject container)
- {
- FileNode file = (FileNode)item;
- if (!file.IsFile)
- return FolderTemplate;
- else
- return FileTemplate;
- }
- }
- }
|