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.
32 lines
920 B
32 lines
920 B
using System;
|
|
using System.Collections.Generic;
|
|
using System.Globalization;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Controls;
|
|
using System.Windows.Data;
|
|
|
|
namespace DyeingComputer.ConvertMoels
|
|
{
|
|
/// <summary>
|
|
/// 序号转换器
|
|
/// 获取DataGrid的行号 , 转换为对应的序号
|
|
/// </summary>
|
|
internal class RowToIndexConverter : IValueConverter
|
|
{
|
|
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
|
{
|
|
DataGridRow row = value as DataGridRow;
|
|
if (row != null)
|
|
return row.GetIndex() + 1;
|
|
else
|
|
return -1;
|
|
}
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
}
|
|
}
|
|
|