This repository has been archived on 2024-01-02. You can view files and clone it, but cannot push or open issues or pull requests.
Sic06/FrameworkLocal/UIClient/DataGridTransform/DataGridExtern/ListBoxItemSelector.cs

28 lines
726 B
C#
Raw Normal View History

2023-01-13 10:57:37 +08:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using System.Windows;
using DataGridTransform;
namespace DataGridTransform
{
public class ListBoxItemSelector : DataTemplateSelector
{
public override DataTemplate SelectTemplate(object item, DependencyObject container)
{
DataGridDynamicColumn convertItem = item as DataGridDynamicColumn;
if (convertItem != null)
{
if (convertItem.isHeader)
return convertItem.HeaderTemplate;
else
return convertItem.CellTemplate;
}
return null;
}
}
}