DocumentsTemplateSelector.cs 670 B

12345678910111213141516171819202122232425262728
  1. using System.Windows;
  2. using System.Windows.Controls;
  3. using AvalonDock.Layout;
  4. using PixiEditor.Models.DataHolders;
  5. using PixiEditor.ViewModels;
  6. namespace PixiEditor.Helpers.UI
  7. {
  8. public class DocumentsTemplateSelector : DataTemplateSelector
  9. {
  10. public DocumentsTemplateSelector()
  11. {
  12. }
  13. public DataTemplate DocumentsViewTemplate { get; set; }
  14. public override DataTemplate SelectTemplate(object item, DependencyObject container)
  15. {
  16. if (item is Document)
  17. {
  18. return DocumentsViewTemplate;
  19. }
  20. return base.SelectTemplate(item, container);
  21. }
  22. }
  23. }