1234567891011121314151617181920212223242526272829303132333435363738 |
- 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.PMs
- {
- public class PMTemplateSelector : DataTemplateSelector
- {
- public DataTemplate DefaultTemplate { get; set; }
- public DataTemplate ShareTemplate { get; set; }
- public DataTemplate DropDownListTemplate { get; set; }
- public override DataTemplate SelectTemplate(object item, DependencyObject container)
- {
- PMParameter m_value = item as PMParameter;
- if (m_value != null)
- {
- switch (m_value.Type)
- {
- case ParameterType.Share:
- return ShareTemplate;
- case ParameterType.DropDownList:
- return DropDownListTemplate;
- default:
- return DefaultTemplate;
- }
- }
- else
- return null;
- }
- }
- }
|