终端一体化运控平台
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.
 
 
 

30 line
741 B

  1. using S7.Net.Types;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using System.Windows.Controls;
  8. namespace BPASmartClient.MorkCL.Converter
  9. {
  10. public class MyDataTemplateSelector:DataTemplateSelector
  11. {
  12. public DataTemplate IntTemplate { get; set; }
  13. public DataTemplate ClassTemplate { get; set; }
  14. public override DataTemplate SelectTemplate(object item, DependencyObject container)
  15. {
  16. if (item is int)
  17. {
  18. return IntTemplate;
  19. }
  20. else if (item is MaterialBase)
  21. {
  22. return ClassTemplate;
  23. }
  24. return null;
  25. }
  26. }
  27. }